QMessageLogContext Class

The QMessageLogContext class provides additional information about a log message. 更多...

头: #include <QMessageLogContext>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

详细描述

The class provides information about the source code location a qDebug (), qInfo (), qWarning (), qCritical () 或 qFatal () message was generated.

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

另请参阅 QMessageLogger , QtMessageHandler ,和 qInstallMessageHandler ().