summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-02-08 12:42:15 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-02-11 03:32:25 +0000
commita29e1fc708600aa8bdbce4163854574c0daab857 (patch)
treed5decceadf6b92785270e9590bc02edd7a22a443
parent3cee4308dc87b58918ad2594918d1cda574428d0 (diff)
logging: Don't build alternate logging sinks for QT_BOOTSTRAPPED
This means willLogToConsole does not need to consider the boostrapped case anymore. Change-Id: I088245362cd46c582a2a08225d22e4d2e4645c06 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/global/qlogging.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 7e4425bd34..a860339473 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -205,8 +205,6 @@ static bool willLogToConsole()
#if defined(Q_OS_WINRT)
// these systems have no stderr, so always log to the system log
return false;
-#elif defined(QT_BOOTSTRAPPED)
- return true;
#else
// rules to determine if we'll log preferably to the console:
// 1) if QT_LOGGING_TO_CONSOLE is set, it determines behavior:
@@ -1459,6 +1457,10 @@ static QBasicAtomicPointer<void (QtMsgType, const QMessageLogContext &, const QS
// ------------------------ Alternate logging sinks -------------------------
+#if defined(QT_BOOTSTRAPPED)
+ // Boostrapped tools always print to stderr, so no need for alternate sinks
+#else
+
#if QT_CONFIG(slog2)
#ifndef QT_LOG_CODE
#define QT_LOG_CODE 9000
@@ -1632,6 +1634,8 @@ static bool win_message_handler(QtMsgType type, const QMessageLogContext &contex
}
#endif
+#endif // Bootstrap check
+
// --------------------------------------------------------------------------
/*!
@@ -1648,16 +1652,18 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
// In the future, if we allow multiple/dynamic sinks, this will be iterating
// a list of sinks.
-#if defined(Q_OS_WIN)
+#if !defined(QT_BOOTSTRAPPED)
+# if defined(Q_OS_WIN)
handledStderr |= win_message_handler(type, context, message);
-#elif QT_CONFIG(slog2)
+# elif QT_CONFIG(slog2)
handledStderr |= slog2_default_handler(type, context, message);
-#elif QT_CONFIG(journald)
+# elif QT_CONFIG(journald)
handledStderr |= systemd_default_message_handler(type, context, message);
-#elif QT_CONFIG(syslog)
+# elif QT_CONFIG(syslog)
handledStderr |= syslog_default_message_handler(type, context, message);
-#elif defined(Q_OS_ANDROID)
+# elif defined(Q_OS_ANDROID)
handledStderr |= android_default_message_handler(type, context, message);
+# endif
#endif
if (handledStderr)