![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtCore More...
#include <qlogging.h>
Public Member Functions | |
| constexpr | QMessageLogger () |
| Constructs a default QMessageLogger. | |
| constexpr | QMessageLogger (const char *file, int line, const char *function) |
| Constructs a QMessageLogger to record log messages for file at line in function. | |
| constexpr | QMessageLogger (const char *file, int line, const char *function, const char *category) |
| Constructs a QMessageLogger to record category messages for file at line in function. | |
| void | debug (const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(2 |
| Logs a debug message specified with format msg. | |
| void void | noDebug (const char *,...) const Q_ATTRIBUTE_FORMAT_PRINTF(2 |
| void void Q_DECL_COLD_FUNCTION void | warning (const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(2 |
| Logs a warning message specified with format msg. | |
| void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void | critical (const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(2 |
| Logs a critical message specified with format msg. | |
| void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void | fatal (const char *msg,...) const noexcept Q_ATTRIBUTE_FORMAT_PRINTF(2 |
| Logs a fatal message specified with format msg. | |
| void | debug (const QLoggingCategory &cat, const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| Logs a debug message specified with format msg for the context cat. | |
| void void | debug (CategoryFunction catFunc, const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| void void void | info (const QLoggingCategory &cat, const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| Logs an informational message specified with format msg for the context cat. | |
| void void void void | info (CategoryFunction catFunc, const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| void void void void Q_DECL_COLD_FUNCTION void | warning (const QLoggingCategory &cat, const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| Logs a warning message specified with format msg for the context cat. | |
| void void void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void | warning (CategoryFunction catFunc, const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| void void void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void | critical (const QLoggingCategory &cat, const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| Logs a critical message specified with format msg for the context cat. | |
| void void void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void | critical (CategoryFunction catFunc, const char *msg,...) const Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| void void void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void | fatal (const QLoggingCategory &cat, const char *msg,...) const noexcept Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| Logs a fatal message specified with format msg for the context cat. | |
| void void void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void | fatal (CategoryFunction catFunc, const char *msg,...) const noexcept Q_ATTRIBUTE_FORMAT_PRINTF(3 |
| void void void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void QDebug | debug () const |
| Logs a debug message using a QDebug stream. | |
| QDebug | debug (const QLoggingCategory &cat) const |
| Logs a debug message into category cat using a QDebug stream. | |
| QDebug | debug (CategoryFunction catFunc) const |
| QDebug | info () const |
| Logs an informational message using a QDebug stream. | |
| QDebug | info (const QLoggingCategory &cat) const |
| Logs an informational message into the category cat using a QDebug stream. | |
| QDebug | info (CategoryFunction catFunc) const |
| Q_DECL_COLD_FUNCTION QDebug | warning () const |
| Logs a warning message using a QDebug stream. | |
| Q_DECL_COLD_FUNCTION QDebug | warning (const QLoggingCategory &cat) const |
| Logs a warning message into category cat using a QDebug stream. | |
| Q_DECL_COLD_FUNCTION QDebug | warning (CategoryFunction catFunc) const |
| Q_DECL_COLD_FUNCTION QDebug | critical () const |
| Logs a critical message using a QDebug stream. | |
| Q_DECL_COLD_FUNCTION QDebug | critical (const QLoggingCategory &cat) const |
| Logs a critical message into category cat using a QDebug stream. | |
| Q_DECL_COLD_FUNCTION QDebug | critical (CategoryFunction catFunc) const |
| Q_DECL_COLD_FUNCTION QDebug | fatal () const |
| Logs a fatal message using a QDebug stream. | |
| Q_DECL_COLD_FUNCTION QDebug | fatal (const QLoggingCategory &cat) const |
| Logs a fatal message into category cat using a QDebug stream. | |
| Q_DECL_COLD_FUNCTION QDebug | fatal (CategoryFunction catFunc) const |
| QNoDebug | noDebug (...) const noexcept |
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 73 of file qlogging.h.
|
inlineconstexpr |
Constructs a default QMessageLogger.
See the other constructors to specify context information.
Definition at line 77 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 78 of file qlogging.h.
|
inlineconstexpr |
Constructs a QMessageLogger to record category messages for file at line in function.
Definition at line 80 of file qlogging.h.
| QDebug QMessageLogger::critical | ( | ) | const |
Logs a critical message using a QDebug stream.
Definition at line 795 of file qlogging.cpp.
| 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 738 of file qlogging.cpp.
| QDebug QMessageLogger::critical | ( | const QLoggingCategory & | cat | ) | const |
Logs a critical message into category cat using a QDebug stream.
Definition at line 809 of file qlogging.cpp.
| 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 754 of file qlogging.cpp.
| QDebug QMessageLogger::debug | ( | ) | const |
Logs a debug message using a QDebug stream.
Definition at line 501 of file qlogging.cpp.
| 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 411 of file qlogging.cpp.
| QDebug QMessageLogger::debug | ( | const QLoggingCategory & | cat | ) | const |
Logs a debug message into category cat using a QDebug stream.
Definition at line 515 of file qlogging.cpp.
| 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 459 of file qlogging.cpp.
| QDebug QMessageLogger::fatal | ( | ) | const |
| 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 886 of file qlogging.cpp.
| QDebug QMessageLogger::fatal | ( | const QLoggingCategory & | cat | ) | const |
Logs a fatal message into category cat using a QDebug stream.
Definition at line 921 of file qlogging.cpp.
|
noexcept |
Logs a fatal message specified with format msg for the context cat.
Additional parameters, specified by msg, may be used.
Definition at line 842 of file qlogging.cpp.
| QDebug QMessageLogger::info | ( | ) | const |
Logs an informational message using a QDebug stream.
Definition at line 590 of file qlogging.cpp.
| 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 604 of file qlogging.cpp.
| 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 547 of file qlogging.cpp.
|
inlinenoexcept |
Ignores logging output
| QDebug QMessageLogger::warning | ( | ) | const |
Logs a warning message using a QDebug stream.
Definition at line 693 of file qlogging.cpp.
| 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 636 of file qlogging.cpp.
| QDebug QMessageLogger::warning | ( | const QLoggingCategory & | cat | ) | const |
Logs a warning message into category cat using a QDebug stream.
Definition at line 706 of file qlogging.cpp.
| 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 652 of file qlogging.cpp.
| void void Q_DECL_COLD_FUNCTION void Q_DECL_COLD_FUNCTION void QT_MESSAGE_LOGGER_NORETURN Q_DECL_COLD_FUNCTION void typedef const QLoggingCategory &(*) 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 94 of file qlogging.h.