Yes, it can be toggled at compile time, but for asking people for logs that is quite crap.
Do i really have to make my own qDebug shim to be able to turn it on and off at runtime?
The google results seems to say this, but there are lots of smart people here so i thought i should ask none the less.
Exactly, when you create file ~/.config/QtProject/qtlogging.ini with this content:
[Rules]
*.debug=true
qt.*.debug=false
it will turn on debug logging for all applications, when you switch even qt.*.debug to true, it will enable debug messages from Qt internal classes, you will see huge noise from QML components…
It seems that QT_LOGGING_RULES has no effect with Qt 5.6 used on Sailfish OS. Beside debug toggle, you may control format of log messages by environment variable QT_MESSAGE_PATTERN. It is nicely described on this post: Nicer debug output in Qt using QT_MESSAGE_PATTERN I really like the usage of red color for warning messages
@nephros , @karry Interesting; that instinctively felt compile-time too, but i see now i was mistaken.
However; that will apply to all applications, right?
I’m more after something for just my application, and that i can tell users to enable if they have problems.
Not sure if this is a yes or no answer; qDebug() is affected, but/and it needed no updates in its usage.
Setting enabled/disabled for debug messages in the default category toggles all regular qDebug() and even QML console.log() on or off.
The reading it back is just for the parts that are not Qt.