![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include "qlogging.h"
#include "qlogging_p.h"
#include "qbytearray.h"
#include "qlist.h"
#include "qcoreapplication.h"
#include "private/qcoreapplication_p.h"
#include "qdatetime.h"
#include "qdebug.h"
#include "qgettid_p.h"
#include "private/qlocking_p.h"
#include "qloggingcategory.h"
#include "private/qloggingregistry_p.h"
#include "qmutex.h"
#include "qscopeguard.h"
#include "qstring.h"
#include "qtcore_tracepoints_p.h"
#include "qthread.h"
#include "qvarlengtharray.h"
#include <cstdlib>
#include <algorithm>
#include <chrono>
#include <memory>
#include <vector>
#include <stdio.h>
Go to the source code of this file.
Classes | |
struct | QMessagePattern |
struct | QMessagePattern::BacktraceParams |
Namespaces | |
namespace | QtPrivate |
Macros | |
#define | IF_TOKEN(LEVEL) |
#define | HANDLE_IF_TOKEN(LEVEL) |
Variables | |
static const char | categoryTokenC [] = "%{category}" |
static const char | typeTokenC [] = "%{type}" |
static const char | messageTokenC [] = "%{message}" |
static const char | fileTokenC [] = "%{file}" |
static const char | lineTokenC [] = "%{line}" |
static const char | functionTokenC [] = "%{function}" |
static const char | pidTokenC [] = "%{pid}" |
static const char | appnameTokenC [] = "%{appname}" |
static const char | threadidTokenC [] = "%{threadid}" |
static const char | qthreadptrTokenC [] = "%{qthreadptr}" |
static const char | timeTokenC [] = "%{time" |
static const char | backtraceTokenC [] = "%{backtrace" |
static const char | ifCategoryTokenC [] = "%{if-category}" |
static const char | ifDebugTokenC [] = "%{if-debug}" |
static const char | ifInfoTokenC [] = "%{if-info}" |
static const char | ifWarningTokenC [] = "%{if-warning}" |
static const char | ifCriticalTokenC [] = "%{if-critical}" |
static const char | ifFatalTokenC [] = "%{if-fatal}" |
static const char | endifTokenC [] = "%{endif}" |
static const char | emptyTokenC [] = "" |
static Q_CONSTINIT QBasicAtomicPointer< void(QtMsgType, const QMessageLogContext &, const QString &)> | messageHandler = Q_BASIC_ATOMIC_INITIALIZER(nullptr) |
static constexpr SystemMessageSink | systemMessageSink |
static Q_CONSTINIT thread_local bool | msgHandlerGrabbed = false |
#define HANDLE_IF_TOKEN | ( | LEVEL | ) |
#define IF_TOKEN | ( | LEVEL | ) |
|
static |
Definition at line 136 of file qlogging.cpp.
Referenced by isFatal().
|
staticnoexcept |
Definition at line 2283 of file qlogging.cpp.
|
static |
Definition at line 1558 of file qlogging.cpp.
|
static |
Definition at line 1992 of file qlogging.cpp.
|
static |
Definition at line 150 of file qlogging.cpp.
|
static |
Definition at line 879 of file qlogging.cpp.
|
static |
Definition at line 161 of file qlogging.cpp.
References checked_var_value(), QtCriticalMsg, and QtFatalMsg.
|
static |
Definition at line 1960 of file qlogging.cpp.
Q_DECLARE_TYPEINFO | ( | QMessagePattern::BacktraceParams | , |
Q_RELOCATABLE_TYPE | ) |
Q_TRACE_POINT | ( | qtcore | , |
qt_message_print | , | ||
int | type, | ||
const char * | category, | ||
const char * | function, | ||
const char * | file, | ||
int | line, | ||
const QString & | message ) |
Q_AUTOTEST_EXPORT QByteArray qCleanupFuncinfo | ( | QByteArray | info | ) |
Definition at line 887 of file qlogging.cpp.
|
static |
Definition at line 1975 of file qlogging.cpp.
void qErrnoWarning | ( | const char * | msg, |
... ) |
Definition at line 2072 of file qlogging.cpp.
void qErrnoWarning | ( | int | code, |
const char * | msg, | ||
... ) |
Definition at line 2088 of file qlogging.cpp.
QtMessageHandler qInstallMessageHandler | ( | QtMessageHandler | h | ) |
Definition at line 2266 of file qlogging.cpp.
Definition at line 2275 of file qlogging.cpp.
|
static |
\inmodule QtCore \title Qt Logging Types
The <QtLogging> header file defines Qt logging types, functions and macros.
The <QtLogging> header file contains several types, functions and macros for logging.
The QtMsgType enum identifies the various messages that can be generated and sent to a Qt message handler; QtMessageHandler is a type definition for a pointer to a function with the signature {void
myMessageHandler(QtMsgType, const QMessageLogContext &, const char *)}. qInstallMessageHandler() function can be used to install the given QtMessageHandler. QMessageLogContext class contains the line, file, and function the message was logged at. This information is created by the QMessageLogger class.
<QtLogging> also contains functions that generate messages from the given string argument: qDebug(), qInfo(), qWarning(), qCritical(), and qFatal(). These functions call the message handler with the given message.
Example:
Definition at line 2030 of file qlogging.cpp.
|
static |
Definition at line 333 of file qlogging.cpp.
void qt_message_output | ( | QtMsgType | msgType, |
const QMessageLogContext & | context, | ||
const QString & | message ) |
Definition at line 2065 of file qlogging.cpp.
|
static |
Definition at line 2006 of file qlogging.cpp.
|
static |
Definition at line 1917 of file qlogging.cpp.
|
static |
Returns true if writing to stderr
will end up in a console/terminal visible to the user.
This is typically the case if the application was started from the command line.
If the application is started without a controlling console/terminal, but the parent process reads stderr
and presents it to the user in some other way, the parent process may override the detection in this function by setting the QT_ASSUME_STDERR_HAS_CONSOLE environment variable to 1
.
Definition at line 212 of file qlogging.cpp.
References systemHasStderr().
Referenced by QtPrivate::shouldLogToStderr().
|
static |
Returns true if writing to stderr
is supported.
Definition at line 187 of file qlogging.cpp.
Referenced by stderrHasConsoleAttached().
|
static |
Definition at line 2001 of file qlogging.cpp.
|
static |
Definition at line 1060 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().
|
static |
Definition at line 1064 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().
|
static |
Definition at line 1053 of file qlogging.cpp.
Referenced by QMessagePattern::setDefaultPattern(), and QMessagePattern::setPattern().
|
static |
Definition at line 1072 of file qlogging.cpp.
|
static |
Definition at line 1071 of file qlogging.cpp.
Referenced by QMessagePattern::setDefaultPattern(), and QMessagePattern::setPattern().
|
static |
Definition at line 1056 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().
|
static |
Definition at line 1058 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().
|
static |
Definition at line 1065 of file qlogging.cpp.
Referenced by QMessagePattern::setDefaultPattern().
|
static |
Definition at line 1069 of file qlogging.cpp.
|
static |
Definition at line 1066 of file qlogging.cpp.
|
static |
Definition at line 1070 of file qlogging.cpp.
|
static |
Definition at line 1067 of file qlogging.cpp.
|
static |
Definition at line 1068 of file qlogging.cpp.
|
static |
Definition at line 1057 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().
|
static |
Definition at line 1678 of file qlogging.cpp.
|
static |
Definition at line 1055 of file qlogging.cpp.
Referenced by QMessagePattern::setDefaultPattern(), and QMessagePattern::setPattern().
|
static |
Definition at line 1990 of file qlogging.cpp.
|
static |
Definition at line 1059 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().
|
static |
Definition at line 1062 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().
|
staticconstexpr |
Definition at line 1940 of file qlogging.cpp.
|
static |
Definition at line 1061 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().
|
static |
Definition at line 1063 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().
|
static |
Definition at line 1054 of file qlogging.cpp.
Referenced by QMessagePattern::setPattern().