16#include <QtCore/private/qlocking_p.h>
18#ifndef QT_BOOTSTRAPPED
24#include "private/qloggingregistry_p.h"
25#include "private/qcoreapplication_p.h"
26#include <qtcore_tracepoints_p.h>
37#if __has_include(<paths.h>)
42#include <android/log.h>
46#include <QtCore/private/qcore_mac_p.h>
49#if QT_CONFIG(journald)
50# define SD_JOURNAL_SUPPRESS_LOCATION
51# include <systemd/sd-journal.h>
58# include <sys/types.h>
61# include "private/qcore_unix_p.h"
65#include <emscripten/emscripten.h>
69extern char *__progname;
72#ifdef QLOGGING_HAVE_BACKTRACE
76#ifdef QLOGGING_USE_EXECINFO_BACKTRACE
80# include BACKTRACE_HEADER
84#ifndef QT_BOOTSTRAPPED
85#if defined(Q_OS_LINUX) && (defined(__GLIBC__) || __has_include(<sys/syscall.h>))
86# include <sys/syscall.h>
88# if defined(Q_OS_ANDROID) && !defined(SYS_gettid)
89# define SYS_gettid __NR_gettid
92static long qt_gettid()
96 return syscall(SYS_gettid);
98#elif defined(Q_OS_DARWIN)
100static int qt_gettid()
104 pthread_threadid_np(NULL, &tid);
107#elif defined(Q_OS_FREEBSD_KERNEL) && defined(__FreeBSD_version) && __FreeBSD_version >= 900031
108# include <pthread_np.h>
109static int qt_gettid()
111 return pthread_getthreadid_np();
114static QT_PREPEND_NAMESPACE(
qint64) qt_gettid()
133#ifndef QT_BOOTSTRAPPED
167template <
typename String>
168#if !defined(Q_CC_MSVC_ONLY)
174 const QString &formattedMessage);
196 int v =
n.loadRelaxed();
197 while (
v != 0 && !
n.testAndSetRelaxed(
v,
v - 1,
v))
260 fprintf(stderr,
"warning: Environment variable QT_LOGGING_TO_CONSOLE is deprecated, use\n"
261 "QT_ASSUME_STDERR_HAS_CONSOLE and/or QT_FORCE_STDERR_LOGGING instead.\n");
269 return GetConsoleWindow();
270#elif defined(Q_OS_UNIX)
272# define _PATH_TTY "/dev/tty"
280 }
else if (errno == ENOENT || errno == EPERM || errno == ENXIO) {
282 return isatty(STDERR_FILENO);
353#if defined(Q_CC_MSVC_ONLY) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
354static inline void convert_to_wchar_t_elided(
wchar_t *
d,
size_t space,
const char *
s)
noexcept
357 if (
len + 1 > space) {
358 const size_t skip =
len - space + 4;
361 for (
int i = 0;
i < 3; ++
i)
437 if (!cat.isDebugEnabled())
456 const char *msg, ...)
const
459 if (!cat.isDebugEnabled())
470#ifndef QT_NO_DEBUG_STREAM
481 ctxt.copyContextFrom(context);
494 if (!cat.isDebugEnabled())
495 dbg.stream->message_output =
false;
498 ctxt.copyContextFrom(context);
512 return debug((*catFunc)());
538 if (!cat.isInfoEnabled())
557 const char *msg, ...)
const
560 if (!cat.isInfoEnabled())
571#ifndef QT_NO_DEBUG_STREAM
583 ctxt.copyContextFrom(context);
596 if (!cat.isInfoEnabled())
597 dbg.stream->message_output =
false;
600 ctxt.copyContextFrom(context);
614 return info((*catFunc)());
643 if (!cat.isWarningEnabled())
662 const char *msg, ...)
const
665 if (!cat.isWarningEnabled())
676#ifndef QT_NO_DEBUG_STREAM
686 ctxt.copyContextFrom(context);
698 if (!cat.isWarningEnabled())
699 dbg.stream->message_output =
false;
702 ctxt.copyContextFrom(context);
745 if (!cat.isCriticalEnabled())
764 const char *msg, ...)
const
767 if (!cat.isCriticalEnabled())
778#ifndef QT_NO_DEBUG_STREAM
788 ctxt.copyContextFrom(context);
801 if (!cat.isCriticalEnabled())
802 dbg.stream->message_output =
false;
805 ctxt.copyContextFrom(context);
840#ifndef Q_CC_MSVC_ONLY
853 const char *msg, ...) const noexcept
864#ifndef Q_CC_MSVC_ONLY
883#ifndef Q_CC_MSVC_ONLY
888#ifndef QT_NO_DEBUG_STREAM
900 ctxt.copyContextFrom(context);
915 ctxt.copyContextFrom(context);
929 return fatal((*catFunc)());
933#if !defined(QT_BOOTSTRAPPED)
956 if (
info.endsWith(
']') && !(
info.startsWith(
'+') ||
info.startsWith(
'-'))) {
963 if (
info.endsWith(
' ')) {
969 static const char operator_call[] =
"operator()";
970 static const char operator_lessThan[] =
"operator<";
971 static const char operator_greaterThan[] =
"operator>";
972 static const char operator_lessThanEqual[] =
"operator<=";
973 static const char operator_greaterThanEqual[] =
"operator>=";
976 info.replace(
"operator ",
"operator");
987 if (
info.indexOf(
'>',
pos) != -1
988 ||
info.indexOf(
':',
pos) != -1) {
997 while (
pos && parencount) {
1004 if (parencount != 0)
1009 if (
info.at(
pos - 1) ==
')') {
1026 int templatecount = 0;
1033 if (
info.indexOf(operator_call) ==
pos -
qsizetype(strlen(operator_call)) + 1)
1037 if (
info.indexOf(operator_lessThan) ==
pos -
qsizetype(strlen(operator_lessThan)) + 1)
1041 if (
info.indexOf(operator_greaterThan) ==
pos -
qsizetype(strlen(operator_greaterThan)) + 1)
1045 auto operatorLength =
qsizetype(strlen(operator_lessThanEqual));
1046 if (
info.indexOf(operator_lessThanEqual) ==
pos - operatorLength + 1)
1048 else if (
info.indexOf(operator_greaterThanEqual) ==
pos - operatorLength + 1)
1058 if (parencount < 0 || templatecount < 0)
1070 else if (
c ==
' ' && templatecount == 0 && parencount == 0)
1078 while ((
info.at(0) ==
'*')
1079 || (
info.at(0) ==
'&'))
1084 while ((
pos =
info.lastIndexOf(
'>')) != -1) {
1085 if (!
info.contains(
'<'))
1092 while (
pos && templatecount) {
1139 std::unique_ptr<std::unique_ptr<const char[]>[]>
literals;
1142#ifndef QT_BOOTSTRAPPED
1145#ifdef QLOGGING_HAVE_BACKTRACE
1146 struct BacktraceParams
1151 QList<BacktraceParams> backtraceArgs;
1152 int maxBacktraceDepth = 0;
1158#ifdef QLOGGING_HAVE_BACKTRACE
1166#ifndef QT_BOOTSTRAPPED
1170 if (envPattern.isEmpty()) {
1184#ifdef QLOGGING_HAVE_BACKTRACE
1185 backtraceArgs.clear();
1186 maxBacktraceDepth = 0;
1190 QList<QString> lexemes;
1192 bool inPlaceholder =
false;
1195 if (
c == u
'%' && !inPlaceholder) {
1199 if (!lexeme.isEmpty()) {
1200 lexemes.append(lexeme);
1203 inPlaceholder =
true;
1209 if (
c == u
'}' && inPlaceholder) {
1211 lexemes.append(lexeme);
1213 inPlaceholder =
false;
1216 if (!lexeme.isEmpty())
1217 lexemes.append(lexeme);
1220 std::vector<std::unique_ptr<const char[]>> literalsVar;
1221 tokens.reset(
new const char *[lexemes.size() + 1]);
1222 tokens[lexemes.size()] =
nullptr;
1224 bool nestedIfError =
false;
1228 for (
int i = 0;
i < lexemes.size(); ++
i) {
1230 if (lexeme.startsWith(
"%{"_L1) && lexeme.endsWith(u
'}')) {
1254 qsizetype spaceIdx = lexeme.indexOf(QChar::fromLatin1(
' '));
1256 timeArgs.
append(lexeme.mid(spaceIdx + 1, lexeme.size() - spaceIdx - 2));
1260#ifdef QLOGGING_HAVE_BACKTRACE
1263 int backtraceDepth = 5;
1270 error +=
"QT_MESSAGE_PATTERN: %{backtrace} depth must be a number greater than 0\n"_L1;
1272 backtraceDepth =
depth;
1274 m = separatorRx.match(lexeme);
1276 backtraceSeparator =
m.captured(1);
1277 BacktraceParams backtraceParams;
1278 backtraceParams.backtraceDepth = backtraceDepth;
1279 backtraceParams.backtraceSeparator = backtraceSeparator;
1280 backtraceArgs.append(backtraceParams);
1281 maxBacktraceDepth =
qMax(maxBacktraceDepth, backtraceDepth);
1283 error +=
"QT_MESSAGE_PATTERN: %{backtrace} is not supported by this Qt build\n"_L1;
1288#define IF_TOKEN(LEVEL) \
1289 else if (lexeme == QLatin1StringView(LEVEL)) { \
1291 nestedIfError = true; \
1292 tokens[i] = LEVEL; \
1304 if (!inIf && !nestedIfError)
1305 error +=
"QT_MESSAGE_PATTERN: %{endif} without an %{if-*}\n"_L1;
1309 error +=
"QT_MESSAGE_PATTERN: Unknown placeholder "_L1 + lexeme +
'\n'_L1;
1312 using UP = std::unique_ptr<char[]>;
1313 tokens[
i] = literalsVar.emplace_back(UP(
qstrdup(lexeme.toLatin1().constData()))).get();
1317 error +=
"QT_MESSAGE_PATTERN: %{if-*} cannot be nested\n"_L1;
1319 error +=
"QT_MESSAGE_PATTERN: missing %{endif}\n"_L1;
1321 if (!
error.isEmpty()) {
1326 "QMessagePattern::setPattern",
nullptr);
1330 literals.reset(
new std::unique_ptr<
const char[]>[literalsVar.size() + 1]);
1331 std::move(literalsVar.begin(), literalsVar.end(), &
literals[0]);
1334#if defined(QLOGGING_HAVE_BACKTRACE)
1347static constexpr int TypicalBacktraceFrameCount = 3;
1348static constexpr const char *QtCoreLibraryName =
"Qt" QT_STRINGIFY(QT_VERSION_MAJOR)
"Core";
1350#if defined(QLOGGING_USE_STD_BACKTRACE)
1354 backtrace = std::stacktrace::current(0, TypicalBacktraceFrameCount + frameCount);
1358backtraceFramesForLogMessage(
int frameCount,
1366#if defined(_MSVC_STL_VERSION)
1367 const auto libraryNameEnd = description.indexOf(
'!');
1368 if (libraryNameEnd != -1) {
1369 const auto libraryName = description.first(libraryNameEnd);
1370 if (!libraryName.contains(QtCoreLibraryName))
1374 if (description.contains(
"populateBacktrace"))
1376 if (description.contains(
"QInternalMessageLogContext"))
1378 if (description.contains(
"~QDebug"))
1384 const std::string description =
entry.description();
1385 if (
result.isEmpty() && shouldSkipFrame(description))
1393#elif defined(QLOGGING_USE_EXECINFO_BACKTRACE)
1407backtraceFramesForLogMessage(
int frameCount,
1410 struct DecodedFrame {
1416 if (frameCount == 0)
1419 auto shouldSkipFrame = [&
result](
const auto &library,
const auto &
function) {
1422 if (function.isEmpty())
1424 if (function.contains(
"6QDebug"_L1))
1426 if (function.contains(
"14QMessageLogger"_L1))
1428 if (function.contains(
"17qt_message_output"_L1))
1430 if (function.contains(
"26QInternalMessageLogContext"_L1))
1436 if (!function.startsWith(
"_Z"_L1))
1441 if constexpr (
sizeof(function.at(0)) == 1)
1442 return function.
data();
1444 return std::move(function).toUtf8();
1446 QScopedPointer<char, QScopedPointerPodDeleter> demangled;
1447 demangled.reset(abi::__cxa_demangle(fn,
nullptr,
nullptr,
nullptr));
1455# if QT_CONFIG(dladdr)
1458 const char *cachedFname =
nullptr;
1467 if (
const char *lastSlash = strrchr(
info.dli_fname,
'/'))
1472 if (shouldSkipFrame(lib, fn))
1475 QString function = demangled(fn);
1476 if (lib.
data() != cachedFname) {
1477 cachedFname = lib.
data();
1480 return { cachedLibrary, function };
1491 QScopedPointer<char*, QScopedPointerPodDeleter>
strings(backtrace_symbols(&
addr, 1));
1501 if (shouldSkipFrame(library, function))
1504 function = demangled(function);
1505 return { library, function };
1511 if (!
frame.library.isEmpty()) {
1512 if (
frame.function.isEmpty())
1522 if (
result.size() == frameCount)
1528#error "Internal error: backtrace enabled, but no way to gather backtraces available"
1531static QString formatBacktraceForLogMessage(
const QMessagePattern::BacktraceParams backtraceParams,
1539 if (!fullctx.backtrace.has_value())
1542 QString backtraceSeparator = backtraceParams.backtraceSeparator;
1543 int backtraceDepth = backtraceParams.backtraceDepth;
1545 QStringList frames = backtraceFramesForLogMessage(backtraceDepth, *fullctx.backtrace);
1546 if (frames.isEmpty())
1550 if (
ctx.function && frames.at(0).startsWith(u
'?'))
1553 return frames.join(backtraceSeparator);
1596 int timeArgsIdx = 0;
1597#ifdef QLOGGING_HAVE_BACKTRACE
1598 int backtraceArgsIdx = 0;
1611#ifdef QLOGGING_HAVE_BACKTRACE
1652#ifdef QLOGGING_HAVE_BACKTRACE
1654 QMessagePattern::BacktraceParams backtraceParams =
pattern->backtraceArgs.at(backtraceArgsIdx);
1656 message.append(formatBacktraceForLogMessage(backtraceParams,
context));
1661 if (timeFormat ==
"process"_L1) {
1664 }
else if (timeFormat ==
"boot"_L1) {
1669#if QT_CONFIG(datestring)
1670 }
else if (timeFormat.
isEmpty()) {
1679#define HANDLE_IF_TOKEN(LEVEL) \
1680 } else if (token == if##LEVEL##TokenC) { \
1681 skip = type != Qt##LEVEL##Msg;
1687#undef HANDLE_IF_TOKEN
1702#ifndef QLOGGING_HAVE_BACKTRACE
1716#if defined(QT_BOOTSTRAPPED)
1722#define QT_LOG_CODE 9000
1732 formattedMessage.append(u
'\n');
1733 if (slog2_set_default_buffer((slog2_buffer_t)-1) == 0) {
1734 slog2_buffer_set_config_t buffer_config;
1735 slog2_buffer_t buffer_handle;
1737 buffer_config.buffer_set_name = __progname;
1738 buffer_config.num_buffers = 1;
1739 buffer_config.verbosity_level = SLOG2_DEBUG1;
1740 buffer_config.buffer_config[0].buffer_name =
"default";
1741 buffer_config.buffer_config[0].num_pages = 8;
1743 if (slog2_register(&buffer_config, &buffer_handle, 0) == -1) {
1744 fprintf(stderr,
"Error registering slogger2 buffer!\n");
1745 fprintf(stderr,
"%s", formattedMessage.toLocal8Bit().constData());
1751 slog2_set_default_buffer(buffer_handle);
1773 slog2c(NULL, QT_LOG_CODE,
severity, formattedMessage.toLocal8Bit().constData());
1779#if QT_CONFIG(journald)
1782 const QString &formattedMessage)
1787 int priority = LOG_INFO;
1790 priority = LOG_DEBUG;
1793 priority = LOG_INFO;
1796 priority = LOG_WARNING;
1799 priority = LOG_CRIT;
1802 priority = LOG_ALERT;
1806 sd_journal_send(
"MESSAGE=%s", formattedMessage.toUtf8().constData(),
1807 "PRIORITY=%i", priority,
1818#if QT_CONFIG(syslog)
1820 const QString &formattedMessage)
1825 int priority = LOG_INFO;
1828 priority = LOG_DEBUG;
1831 priority = LOG_INFO;
1834 priority = LOG_WARNING;
1837 priority = LOG_CRIT;
1840 priority = LOG_ALERT;
1844 syslog(priority,
"%s", formattedMessage.toUtf8().constData());
1853 const QString &formattedMessage)
1858 android_LogPriority priority = ANDROID_LOG_DEBUG;
1861 priority = ANDROID_LOG_DEBUG;
1864 priority = ANDROID_LOG_INFO;
1867 priority = ANDROID_LOG_WARN;
1870 priority = ANDROID_LOG_ERROR;
1873 priority = ANDROID_LOG_FATAL;
1890 const qsizetype maxOutputStringLength = 32766;
1894 if (
message.length() <= maxOutputStringLength) {
1895 OutputDebugString(
reinterpret_cast<const wchar_t *
>(
message.utf16()));
1897 wchar_t *messagePart =
new wchar_t[maxOutputStringLength + 1];
1902 messagePart[
len] = 0;
1903 OutputDebugString(messagePart);
1905 delete[] messagePart;
1910 const QString &formattedMessage)
1915 win_outputDebugString_helper(formattedMessage + u
'\n');
1924 const QString &formattedMessage)
1927 if (forceStderrLogging)
1930 int emOutputFlags = EM_LOG_CONSOLE;
1931 QByteArray localMsg = formattedMessage.toLocal8Bit();
1938 emOutputFlags |= EM_LOG_WARN;
1941 emOutputFlags |= EM_LOG_ERROR;
1944 emOutputFlags |= EM_LOG_ERROR;
1946 emscripten_log(emOutputFlags,
"%s\n",
qPrintable(formattedMessage));
1957 const QString &formattedMessage)
1964 if (formattedMessage.isNull())
1966 fprintf(stderr,
"%s\n", formattedMessage.toLocal8Bit().constData());
1971struct SystemMessageSink
1975 bool messageIsUnformatted =
false;
1980#if defined(QT_BOOTSTRAPPED)
1982#elif defined(Q_OS_WIN)
1984#elif QT_CONFIG(slog2)
1985 slog2_default_handler
1986#elif QT_CONFIG(journald)
1987 systemd_default_message_handler
1988#elif QT_CONFIG(syslog)
1989 syslog_default_message_handler
1990#elif defined(Q_OS_ANDROID)
1991 android_default_message_handler
1992#elif defined(QT_USE_APPLE_UNIFIED_LOGGING)
1994#elif defined Q_OS_WASM
1995 wasm_default_message_handler
2002 const QString &formattedMessage)
2031#if defined(QT_BOOTSTRAPPED)
2036#elif defined(Q_COMPILER_THREAD_LOCAL)
2038Q_CONSTINIT
static thread_local bool msgHandlerGrabbed =
false;
2042 if (msgHandlerGrabbed)
2045 msgHandlerGrabbed =
true;
2051 msgHandlerGrabbed =
false;
2061#ifndef QT_BOOTSTRAPPED
2067 if (!defaultCategory->isEnabled(msgType))
2084template <
typename String>
2087#if defined(Q_CC_MSVC_ONLY) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
2088 wchar_t contextFileL[256];
2092 convert_to_wchar_t_elided(contextFileL,
sizeof contextFileL /
sizeof *contextFileL,
2095 int reportMode = _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_WNDW);
2096 _CrtSetReportMode(_CRT_ERROR, reportMode);
2098 int ret = _CrtDbgReportW(_CRT_ERROR, contextFileL,
context.line, _CRT_WIDE(QT_VERSION_STR),
2099 reinterpret_cast<const wchar_t *
>(
message.utf16()));
2100 if ((
ret == 0) && (reportMode & _CRTDBG_MODE_WNDW))
2108 if constexpr (std::is_class_v<String> && !std::is_const_v<String>)
2137 buf +=
" ("_L1 + error_string + u
')';
2324#ifndef QT_BOOTSTRAPPED
2329 if (!qMessagePattern()->fromEnvironment)
2330 qMessagePattern()->setPattern(
pattern);
2337 if (logContext.version == self->version) {
2339 self->backtrace =
other->backtrace;
2351 copyContextFrom(logContext);
2353#ifdef QLOGGING_HAVE_BACKTRACE
2358 if (
auto pattern = qMessagePattern())
2359 return pattern->maxBacktraceDepth;
2375 this->
category = logContext.category;
2376 this->
file = logContext.file;
2377 this->
line = logContext.line;
2378 this->function = logContext.function;
2379 if (
Q_UNLIKELY(version == CurrentVersion + 1))
static bool messageHandler(QtMsgType msgType, const QMessageLogContext &context, const QString &message)
static qint64 applicationPid() Q_DECL_CONST_FUNCTION
QString applicationName
the name of this application
static QDateTime currentDateTime()
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QDeadlineTimer current(Qt::TimerType timerType=Qt::CoarseTimer) noexcept
Returns a QDeadlineTimer that is expired but is guaranteed to contain the current time.
void start() noexcept
\typealias QElapsedTimer::Duration Synonym for std::chrono::nanoseconds.
int initFrom(const QMessageLogContext &logContext)
void populateBacktrace(int frameCount)
std::optional< BacktraceStorage > backtrace
constexpr const char * data() const noexcept
constexpr qsizetype size() const noexcept
void append(parameter_type t)
static QLoggingCategory * defaultCategory()
Returns a pointer to the global category "default" that is used, for example, by qDebug(),...
static constexpr int CurrentVersion
Q_DECL_COLD_FUNCTION QDebug critical() const
Logs a critical message using a QDebug stream.
Q_DECL_COLD_FUNCTION QDebug warning() const
Logs a warning message using a QDebug stream.
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.
Q_DECL_COLD_FUNCTION QDebug fatal() const
Logs a fatal message using a QDebug stream.
QDebug info() const
Logs an informational message using a QDebug stream.
QNoDebug noDebug() const noexcept
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 \reentrant
QStringView capturedView(int nth=0) const
\inmodule QtCore \reentrant
int toInt(bool *ok=nullptr, int base=10) const
Returns the string view converted to an int using base base, which is 10 by default and must be betwe...
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
int toInt(bool *ok=nullptr, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromStdString(const std::string &s)
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
QChar * data()
Returns a pointer to the data stored in the QString.
static QString vasprintf(const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(1
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString static QString asprintf(const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1
static Qt::HANDLE currentThreadId() noexcept Q_DECL_PURE_FUNCTION
static QThread * currentThread()
const QLoggingCategory & category()
[1]
static const char functionTokenC[]
static const char typeTokenC[]
static const char timeTokenC[]
static const char endifTokenC[]
static bool grabMessageHandler()
static const char ifInfoTokenC[]
void qt_message_output(QtMsgType msgType, const QMessageLogContext &context, const QString &message)
static Q_NEVER_INLINE void qt_message(QtMsgType msgType, const QMessageLogContext &context, const char *msg, va_list ap)
static const char emptyTokenC[]
static void preformattedMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &formattedMessage)
static bool systemHasStderr()
Returns true if writing to stderr is supported.
static const char ifCategoryTokenC[]
static bool isDefaultCategory(const char *category)
static const char appnameTokenC[]
Q_AUTOTEST_EXPORT QByteArray qCleanupFuncinfo(QByteArray info)
static const char ifCriticalTokenC[]
#define HANDLE_IF_TOKEN(LEVEL)
static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &buf)
static bool is_fatal_count_down(QAtomicInt &n)
static const char qthreadptrTokenC[]
static const char categoryTokenC[]
static const char lineTokenC[]
static const char messageTokenC[]
static const char fileTokenC[]
static void stderr_message_handler(QtMsgType type, const QMessageLogContext &context, const QString &formattedMessage)
static constexpr SystemMessageSink systemMessageSink
static const char pidTokenC[]
static const char threadidTokenC[]
static const char defaultPattern[]
static void ungrabMessageHandler()
static void copyInternalContext(QInternalMessageLogContext *self, const QMessageLogContext &logContext) noexcept
static int checked_var_value(const char *varname)
static Q_CONSTINIT QBasicAtomicPointer< void(QtMsgType, const QMessageLogContext &, const QString &) messageHandler)
static QString formatLogMessage(QtMsgType type, const QMessageLogContext &context, const QString &str)
void qErrnoWarning(const char *msg,...)
static const char ifWarningTokenC[]
static const char ifDebugTokenC[]
static const char backtraceTokenC[]
static Q_NORETURN void qt_message_fatal(QtMsgType, const QMessageLogContext &context, String &&message)
\inmodule QtCore \title Qt Logging Types
static const char ifFatalTokenC[]
static bool isFatal(QtMsgType msgType)
QtMessageHandler qInstallMessageHandler(QtMessageHandler h)
static void qt_message_print(QtMsgType, const QMessageLogContext &context, const QString &message)
static bool stderrHasConsoleAttached()
Returns true if writing to stderr will end up in a console/terminal visible to the user.
void qSetMessagePattern(const QString &pattern)
Combined button and popup list for selecting options.
Lock qt_unique_lock(Mutex &mutex)
bool shouldLogToStderr()
Returns true if logging stderr should be ensured.
QT_BEGIN_NAMESPACE void qAbort()
#define Q_BASIC_ATOMIC_INITIALIZER(a)
size_t qstrlen(const char *str)
Q_CORE_EXPORT char * qstrdup(const char *)
#define QT_WARNING_DISABLE_GCC(text)
static int qt_safe_open(const char *pathname, int flags, mode_t mode=0777)
static int qt_safe_close(int fd)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define QT_TERMINATE_ON_EXCEPTION(expr)
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
#define QT_MESSAGELOG_FILE
Q_DECL_COLD_FUNCTION Q_CORE_EXPORT QString qt_error_string(int errorCode=-1)
Q_CORE_EXPORT QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, const QString &buf)
#define QT_MESSAGELOG_LINE
void(* QtMessageHandler)(QtMsgType, const QMessageLogContext &, const QString &)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLsizei const GLfloat * v
[13]
GLint GLenum GLsizei GLsizei GLsizei depth
GLsizei const GLchar ** strings
[1]
GLenum GLuint GLenum GLsizei length
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei const GLchar * message
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum GLboolean sink
static void decodeFrame(const QString &f, QV4::CppStackFrame **frame)
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
#define qPrintable(string)
#define QStringLiteral(str)
#define Q_AUTOTEST_EXPORT
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
#define Q_TRACE_POINT(provider, tracepoint,...)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
unsigned long long quint64
QT_BEGIN_NAMESPACE Q_ALWAYS_INLINE void qYieldCpu(void) Q_DECL_NOEXCEPT
char * toString(const MyType &t)
[31]
QList< QString > timeArgs
std::unique_ptr< std::unique_ptr< const char[]>[]> literals
void setPattern(const QString &pattern)
std::unique_ptr< const char *[]> tokens