3

I've got a GUI application that makes extensive use of QDebug for logging, and a message handler set up via qInstallMessageHandler.

However, it uses some third-party libraries that print logging info to stdout and stderr.

I'm running into some problems with compatibility. The stdout/stderr messages do show up in the Qt console, although they use a different buffer than the QDebug output and so they're printed significantly out of order relative to QDebug messages. Additionally, things printed to stdout/stderr don't get passed over to the message handler.

My question is: Is it possible to take stdout/stderr and redirect them to whatever handles QDebug messages (in a line-buffered mode, I guess)? If so, how?

Jason C
  • 38,729
  • 14
  • 126
  • 182
  • https://stackoverflow.com/questions/37760630/redirect-stdout-stderr-to-function-in-c ? It seems you cannot. – elcuco Jul 15 '19 at 06:37

0 Answers0