Un article de int21h.
If you are using Qt, you might have some
qWarning statements in your code. But did you know that you can greatly improve the output of those with the
QT_MESSAGE_PATTERN environment variable? This blog post will give you some hints and examples of what you can do.
The default message pattern just prints the message (and the category if one was specified), but qDebug has the possibility to output more information. You can display cool things like the line of code, the function name or more by using some placeholders in the pattern.
Following placeholders are supported:
||Path to source file|
||Line in source file|
||The actual message|
||The system-wide ID of current thread (if it can be obtained)|
||A pointer to the current QThread (result of QThread::currentThread())|
Voir l’article original 270 mots de plus