40 #include <QtCore/qglobal.h>
47 #pragma qt_no_master_include
79 const char *
file =
nullptr;
80 const char *
function =
nullptr;
102 void debug(
const char *
msg, ...)
const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
103 void noDebug(
const char *, ...)
const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3)
105 void info(
const char *
msg, ...)
const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
107 void warning(
const char *
msg, ...)
const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
109 void critical(
const char *
msg, ...)
const Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
116 void info(CategoryFunction catFunc,
const char *
msg, ...)
const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4);
120 void warning(CategoryFunction catFunc,
const char *
msg, ...)
const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4);
124 void critical(CategoryFunction catFunc,
const char *
msg, ...)
const Q_ATTRIBUTE_FORMAT_PRINTF(3, 4);
130 void fatal(
const char *
msg, ...)
const noexcept Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
132 #ifndef QT_NO_DEBUG_STREAM
159 #if !defined(QT_MESSAGELOGCONTEXT) && !defined(QT_NO_MESSAGELOGCONTEXT)
160 # if defined(QT_NO_DEBUG)
161 # define QT_NO_MESSAGELOGCONTEXT
163 # define QT_MESSAGELOGCONTEXT
167 #ifdef QT_MESSAGELOGCONTEXT
168 #define QT_MESSAGELOG_FILE static_cast<const char *>(__FILE__)
169 #define QT_MESSAGELOG_LINE __LINE__
170 #define QT_MESSAGELOG_FUNC static_cast<const char *>(Q_FUNC_INFO)
172 #define QT_MESSAGELOG_FILE nullptr
173 #define QT_MESSAGELOG_LINE 0
174 #define QT_MESSAGELOG_FUNC nullptr
177 #define qDebug QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).debug
178 #define qInfo QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).info
179 #define qWarning QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).warning
180 #define qCritical QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).critical
181 #define qFatal QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).fatal
183 #define QT_NO_QDEBUG_MACRO while (false) QMessageLogger().noDebug
185 #if defined(QT_NO_DEBUG_OUTPUT)
187 # define qDebug QT_NO_QDEBUG_MACRO
189 #if defined(QT_NO_INFO_OUTPUT)
191 # define qInfo QT_NO_QDEBUG_MACRO
193 #if defined(QT_NO_WARNING_OUTPUT)
195 # define qWarning QT_NO_QDEBUG_MACRO
The QDebug class provides an output stream for debugging information.
The QLoggingCategory class represents a category, or 'area' in the logging infrastructure.
The QMessageLogContext class provides additional information about a log message.
constexpr QMessageLogContext() noexcept=default
The QMessageLogger class generates log messages.
QDebug debug(CategoryFunction catFunc) const
constexpr QMessageLogger(const char *file, int line, const char *function, const char *category)
constexpr QMessageLogger()
Q_DECL_COLD_FUNCTION QDebug warning(CategoryFunction catFunc) const
constexpr QMessageLogger(const char *file, int line, const char *function)
Q_DECL_COLD_FUNCTION QDebug critical(CategoryFunction catFunc) const
QDebug info(CategoryFunction catFunc) const
The QString class provides a Unicode character string.
const QLoggingCategory & category()
[1]
auto it unsigned count const
backing_store_ptr info
[4]
#define Q_DECL_COLD_FUNCTION
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
#define Q_DISABLE_COPY(Class)
Q_CORE_EXPORT Q_DECL_COLD_FUNCTION void qErrnoWarning(int code, const char *msg,...)
Q_CORE_EXPORT QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, const QString &buf)
Q_CORE_EXPORT void qSetMessagePattern(const QString &messagePattern)
Q_CORE_EXPORT QtMessageHandler qInstallMessageHandler(QtMessageHandler)
Q_CORE_EXPORT void qt_message_output(QtMsgType, const QMessageLogContext &context, const QString &message)
void(* QtMessageHandler)(QtMsgType, const QMessageLogContext &, const QString &)
GLenum GLuint GLenum GLsizei const GLchar * message
GLenum GLuint GLenum GLsizei const GLchar * buf