QMessageLogContext Class

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

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

详细描述

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 ().