![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore More...
#include <qlogging.h>
Public Attributes | |
void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void typedef const QLoggingCategory &(* | CategoryFunction )() |
This is a typedef for a pointer to a function with the following signature: | |
\inmodule QtCore
The QMessageLogger class generates log messages.
QMessageLogger is used to generate messages for the Qt logging framework. Usually one uses it through qDebug(), qInfo(), qWarning(), qCritical, or qFatal() functions, which are actually macros: For example qDebug() expands to QMessageLogger(FILE, LINE, Q_FUNC_INFO).debug() for debug builds, and QMessageLogger(0, 0, 0).debug() for release builds.
One example of direct use is to forward errors that stem from a scripting language, e.g. QML:
Definition at line 67 of file qlogging.h.
|
inlineconstexpr |
Constructs a default QMessageLogger.
See the other constructors to specify context information.
Definition at line 71 of file qlogging.h.
|
inlineconstexpr |
Constructs a QMessageLogger to record log messages for file at line in function.
The is equivalent to QMessageLogger(file, line, function, "default")
Definition at line 72 of file qlogging.h.
References function.
|
inlineconstexpr |
Constructs a QMessageLogger to record category messages for file at line in function.
Definition at line 74 of file qlogging.h.
References function.
QDebug QMessageLogger::critical | ( | ) | const |
Logs a critical message using a QDebug stream.
Definition at line 833 of file qlogging.cpp.
References QtCriticalMsg.
Q_DECL_COLD_FUNCTION QDebug QMessageLogger::critical | ( | CategoryFunction | catFunc | ) | const |
void void void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void QMessageLogger::critical | ( | CategoryFunction | catFunc, |
const char * | msg, | ||
... | |||
) | const |
void QMessageLogger::critical | ( | const char * | msg, |
... | |||
) | const |
Logs a critical message specified with format msg.
Additional parameters, specified by msg, may be used.
Definition at line 764 of file qlogging.cpp.
References isFatal(), qt_message(), qt_message_fatal(), and QtCriticalMsg.
Referenced by dumpwarning(), QV4::ConsoleObject::method_assert(), and QQmlPrivate::AOTCompiledContext::writeToConsole().
QDebug QMessageLogger::critical | ( | const QLoggingCategory & | cat | ) | const |
Logs a critical message into category cat using a QDebug stream.
Definition at line 847 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), QLoggingCategory::isCriticalEnabled(), and QtCriticalMsg.
void QMessageLogger::critical | ( | const QLoggingCategory & | cat, |
const char * | msg, | ||
... | |||
) | const |
Logs a critical message specified with format msg for the context cat.
Additional parameters, specified by msg, may be used.
Definition at line 782 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), QLoggingCategory::isCriticalEnabled(), isFatal(), qt_message(), qt_message_fatal(), and QtCriticalMsg.
QDebug QMessageLogger::debug | ( | ) | const |
Logs a debug message using a QDebug stream.
Definition at line 489 of file qlogging.cpp.
References QtDebugMsg.
QDebug QMessageLogger::debug | ( | CategoryFunction | catFunc | ) | const |
void void QMessageLogger::debug | ( | CategoryFunction | catFunc, |
const char * | msg, | ||
... | |||
) | const |
void QMessageLogger::debug | ( | const char * | msg, |
... | |||
) | const |
Logs a debug message specified with format msg.
Additional parameters, specified by msg, may be used.
Definition at line 385 of file qlogging.cpp.
References isFatal(), qt_message(), qt_message_fatal(), and QtDebugMsg.
Referenced by dumpwarning(), QV4::ConsoleObject::method_count(), QV4::ConsoleObject::method_profile(), QV4::ConsoleObject::method_profileEnd(), QV4::ConsoleObject::method_trace(), statusChanged(), and QQmlPrivate::AOTCompiledContext::writeToConsole().
QDebug QMessageLogger::debug | ( | const QLoggingCategory & | cat | ) | const |
Logs a debug message into category cat using a QDebug stream.
Definition at line 503 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), QLoggingCategory::isDebugEnabled(), and QtDebugMsg.
void QMessageLogger::debug | ( | const QLoggingCategory & | cat, |
const char * | msg, | ||
... | |||
) | const |
Logs a debug message specified with format msg for the context cat.
Additional parameters, specified by msg, may be used.
Definition at line 437 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), QLoggingCategory::isDebugEnabled(), isFatal(), qt_message(), qt_message_fatal(), and QtDebugMsg.
QDebug QMessageLogger::fatal | ( | ) | const |
Logs a fatal message using a QDebug stream.
Definition at line 950 of file qlogging.cpp.
References QtFatalMsg.
Q_DECL_COLD_FUNCTION QDebug QMessageLogger::fatal | ( | CategoryFunction | catFunc | ) | const |
|
noexcept |
|
noexcept |
Logs a fatal message specified with format msg.
Additional parameters, specified by msg, may be used.
Definition at line 930 of file qlogging.cpp.
References qt_message(), qt_message_fatal(), QT_TERMINATE_ON_EXCEPTION, and QtFatalMsg.
Referenced by qt_assert_x().
QDebug QMessageLogger::fatal | ( | const QLoggingCategory & | cat | ) | const |
Logs a fatal message into category cat using a QDebug stream.
Definition at line 964 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), and QtFatalMsg.
|
noexcept |
Logs a fatal message specified with format msg for the context cat.
Additional parameters, specified by msg, may be used.
Definition at line 882 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), qt_message(), qt_message_fatal(), QT_TERMINATE_ON_EXCEPTION, QtCriticalMsg, and QtFatalMsg.
QDebug QMessageLogger::info | ( | ) | const |
QDebug QMessageLogger::info | ( | CategoryFunction | catFunc | ) | const |
void void void void QMessageLogger::info | ( | CategoryFunction | catFunc, |
const char * | msg, | ||
... | |||
) | const |
QDebug QMessageLogger::info | ( | const QLoggingCategory & | cat | ) | const |
Logs an informational message into the category cat using a QDebug stream.
Definition at line 615 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), QLoggingCategory::isInfoEnabled(), and QtInfoMsg.
void QMessageLogger::info | ( | const QLoggingCategory & | cat, |
const char * | msg, | ||
... | |||
) | const |
Logs an informational message specified with format msg for the context cat.
Additional parameters, specified by msg, may be used.
Definition at line 548 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), isFatal(), QLoggingCategory::isInfoEnabled(), qt_message(), qt_message_fatal(), and QtInfoMsg.
Referenced by dumpwarning(), and QQmlPrivate::AOTCompiledContext::writeToConsole().
|
noexcept |
Returns a QNoDebug object, which is used to ignore debugging output.
Definition at line 534 of file qlogging.cpp.
void QMessageLogger::noDebug | ( | const char * | , |
... | |||
) | const |
Ignores logging output
QDebug QMessageLogger::warning | ( | ) | const |
Logs a warning message using a QDebug stream.
Definition at line 717 of file qlogging.cpp.
References QtWarningMsg.
Q_DECL_COLD_FUNCTION QDebug QMessageLogger::warning | ( | CategoryFunction | catFunc | ) | const |
void void void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void QMessageLogger::warning | ( | CategoryFunction | catFunc, |
const char * | msg, | ||
... | |||
) | const |
void QMessageLogger::warning | ( | const char * | msg, |
... | |||
) | const |
Logs a warning message specified with format msg.
Additional parameters, specified by msg, may be used.
Definition at line 648 of file qlogging.cpp.
References isFatal(), qt_message(), qt_message_fatal(), and QtWarningMsg.
Referenced by dumpwarning(), QV4::QObjectSlotDispatcher::impl(), QV4::ConsoleObject::method_profile(), QV4::ConsoleObject::method_profileEnd(), QQuickView::setContent(), QQuickWidget::setContent(), and QQmlPrivate::AOTCompiledContext::writeToConsole().
QDebug QMessageLogger::warning | ( | const QLoggingCategory & | cat | ) | const |
Logs a warning message into category cat using a QDebug stream.
Definition at line 730 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), QLoggingCategory::isWarningEnabled(), and QtWarningMsg.
void QMessageLogger::warning | ( | const QLoggingCategory & | cat, |
const char * | msg, | ||
... | |||
) | const |
Logs a warning message specified with format msg for the context cat.
Additional parameters, specified by msg, may be used.
Definition at line 666 of file qlogging.cpp.
References QMessageLogContext::category, QLoggingCategory::categoryName(), isFatal(), QLoggingCategory::isWarningEnabled(), qt_message(), qt_message_fatal(), and QtWarningMsg.
QMessageLogger::CategoryFunction |
This is a typedef for a pointer to a function with the following signature:
The Q_DECLARE_LOGGING_CATEGORY
macro generates a function declaration with this signature, and Q_LOGGING_CATEGORY
generates its definition.
Definition at line 88 of file qlogging.h.