Dual Output For qInstallMessageHandler
Hello,
I'm utilizing qInstallMessageHandler with a custom handler to control the format of the message output. This is working correctly. The issue is now that I'm intercepting the data and formatting it, it is no longer making it's way to the Windows debug view as it was prior this. I was using the code provided in the example here.
I then tried instead to push the data out this way:
Passing in the various arguments, which again, works for the IDE but not when running natively and looking to see debug data in the Windows debug view. Is there anyway to have this handler so I can keep messages in the IDE, but also allow for them to be viewed in Windows debug view?
Re: Dual Output For qInstallMessageHandler
Have you tried writing to stderr?
Also have a look at this https://woboq.com/blog/nice-debug-output-with-qt.html for a built-in option on customiing the log output.
Cheers,
_
Re: Dual Output For qInstallMessageHandler
Yeah, I tried stderr as that was what they show in the example but it didn't make a difference. I'll have a look at your link.
Had a look at the link and that is really cool. The only issue is that outside of just altering the look of the message, I need to make certain types conditional and I don't see how you can do that through the pattern QT_MESSAGE_PATTERN.
Re: Dual Output For qInstallMessageHandler
After a bit of digging I found this:
https://code.woboq.org/qt5/qtbase/sr...textRK7QString
Seems the Windows specific code paths of the default message handler uses some Windows API for logging instead of writing to any IO stream.
Cheers,
_
Re: Dual Output For qInstallMessageHandler
Ah - Yes, OutputDebugString. I'll have to try and figure out how to use that. Thanks for finding this.