diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-10-23 20:57:02 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-10-23 20:57:02 +0200 |
commit | 7640a26ac892892539e8bf931fbb7ed6c3c581c4 (patch) | |
tree | c9e24b9b7e39eb461f840ffa45ebf3dcb4bc729f | |
parent | 50195a472ff5ef32ce6cca93df599b9952c98ded (diff) |
logging: Use a global constant for default message pattern
-rw-r--r-- | src/util/logging.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/util/logging.cpp b/src/util/logging.cpp index 438934ba2a..1852728d81 100644 --- a/src/util/logging.cpp +++ b/src/util/logging.cpp @@ -33,6 +33,8 @@ QFile s_logfile; bool s_debugAssertBreak = false; const QString kThreadNamePattern = QStringLiteral("{{threadname}}"); +const QString kDefaultMessagePattern = QStringLiteral("%{type} [") + + kThreadNamePattern + QStringLiteral("] %{message}"); const QLoggingCategory kDefaultLoggingCategory = QLoggingCategory(nullptr); @@ -308,11 +310,8 @@ void Logging::initialize( s_debugAssertBreak = debugAssertBreak; - // Set the default message pattern if the QT_MESSAGE_PATTERN variable is - // not set. if (qgetenv("QT_MESSAGE_PATTERN").isEmpty()) { - qSetMessagePattern(QStringLiteral("%{type} [") + kThreadNamePattern + - QStringLiteral("] %{message}")); + qSetMessagePattern(kDefaultMessagePattern); } // Install the Qt message handler. |