Solved Not seeing QDebug output from within a plugin.
-
I am developing a custom virtual keyboard plugin on RHEL 8 using QT5.12.5. It is mostly working, but a few parts are not.
So I decided to add some qDebug outputs to see if I could determine where in the logic flow things stop working properly, just as I would do in a normal app.The problem is that I am not seeing the qDebug output messages I would expect to see. Just to check, I placed a qDebug message in the part of code that is working correctly (I can see it working), and did not get that output either.
Just to be sure, I built the plugin in debug mode, and installed again. And still no qDebug output in the terminal window.
Am I missing some special setting to make it visible ? Or is it going somewhere else I need to look at ?
Thanks,
Dale Pennington -
QDebug
included properly? Correct syntax? (qDebug() << "msg"
orqDebug("msg")
)
Are you using QtCreator? Did you check the QtCreator App Output area for any output?
Do you re-direct messages somewhere else? -
QDebug is included, I am using in inserter mode (and have used it in normal apps before).
I am running on RHEL 8 strait from the Terminal Window, so expected it in the terminal window, with no redirections involved. No QtCreator use involved.
-
@DalePennington
I don't know anything about plugins. But all messages fromqDebug()
go via the application-global message handler. See https://doc.qt.io/qt-5/qtglobal.html#qInstallMessageHandler for how to install your own, and do something there (even just a debugger breakpoint) to see whether it is being hit but you don't know where your messages are going vs it is not being hit at all. -
Tried that as well, and still did not see and qDebug output.
Ended up putting a qDebug() into my main app, in the main window constructor, and still got no qDebug output (build as either debug or release). This is in QT 5.12.5 on RHEL8.
This is actually turning into a significant issue by itself, as we definitely need qDebug to work as it did in QT 4.
-
Have you seen this?
https://bugzilla.redhat.com/show_bug.cgi?id=1227295It was about 5 year ago, but maybe you still have to enable qDebug first, somewhere somehow
-
Yep, that is the answer. If I set default.debug=true I get the qDebug (if I tried *.debug=true I got flooded with everything else).
Now I can either fix it programmatically or add changing the rules to our configuration setup.
Thanks,
Dale -
@Pl45m4 , @DalePennington
I have always been Ubuntu (Qt with distro) and have never had a problem withqDebug()
output, always there. I skimmed through the bug report. I'd be interested to understand: do you know why whatever the cause(s) was it affected RHL and not Debians, in layman's terms? If it was a global configuration file(?), why would that be any different across distros? -
I am assuming that RH made that modification to the file and made it part of the package they distribute. It is an official RPM. An easy way to check would be to see if there is an equivalent qtlogging.ini file on your system. If it is not there, or has different values, than it is something RH elected to add to their distribution.
I did verify the file comes from their Qt5 Qt Base Components package.
-
I'm using Windows as well as Linux (mostly Ubuntu) and also never got any problem with
qDebug
.
Seems to be a Red Hat / Fedora thing.