Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QMessageLogContext in release build



  • Hi,
    i want to store the additional informations of the QMessageLogContext.
    In the docs is written:

    Note: By default, this information is recorded only in debug builds. You can overwrite this explicitly by defining QT_MESSAGELOGCONTEXT or QT_NO_MESSAGELOGCONTEXT.

    But when i define QT_MESSAGELOGCONTEXT in my main.cpp the file, line etc. stoll will not be stored.

    What i am doing wrong?


  • Lifetime Qt Champion

    Hi,

    You should rather add that define in your .pro file.



  • Sorry for the late reply.

    I added the define in the pro file and everything works, thanks!


Log in to reply