From 49a0b0bff27d1943b9bae5dff29b6d5ef3c682f9 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Thu, 4 Mar 2021 01:06:02 +0100 Subject: [PATCH] Show info logging when debugging is off --- ext/libstrawberry-common/core/logging.cpp | 3 +-- ext/libstrawberry-common/core/logging.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/libstrawberry-common/core/logging.cpp b/ext/libstrawberry-common/core/logging.cpp index 325f8ea9a..36570d4cf 100644 --- a/ext/libstrawberry-common/core/logging.cpp +++ b/ext/libstrawberry-common/core/logging.cpp @@ -349,6 +349,7 @@ void DumpStackTrace() { // doesn't override any behavior that should be needed after return. #define qCreateLogger(line, pretty_function, category, level) logging::CreateLogger(logging::Level_##level, logging::ParsePrettyFunction(pretty_function), line, category) +QDebug CreateLoggerInfo(int line, const char *pretty_function, const char* category) { return qCreateLogger(line, pretty_function, category, Info); } QDebug CreateLoggerFatal(int line, const char *pretty_function, const char* category) { return qCreateLogger(line, pretty_function, category, Fatal); } QDebug CreateLoggerError(int line, const char *pretty_function, const char* category) { return qCreateLogger(line, pretty_function, category, Error); } @@ -359,10 +360,8 @@ QDebug CreateLoggerError(int line, const char *pretty_function, const char* cate #endif // QT_NO_WARNING_OUTPUT #ifdef QT_NO_DEBUG_OUTPUT - QNoDebug CreateLoggerInfo(int, const char*, const char*) { return QNoDebug(); } QNoDebug CreateLoggerDebug(int, const char*, const char*) { return QNoDebug(); } #else - QDebug CreateLoggerInfo(int line, const char *pretty_function, const char* category) { return qCreateLogger(line, pretty_function, category, Info); } QDebug CreateLoggerDebug(int line, const char *pretty_function, const char* category) { return qCreateLogger(line, pretty_function, category, Debug); } #endif // QT_NO_DEBUG_OUTPUT diff --git a/ext/libstrawberry-common/core/logging.h b/ext/libstrawberry-common/core/logging.h index 71b189954..10ffe22c0 100644 --- a/ext/libstrawberry-common/core/logging.h +++ b/ext/libstrawberry-common/core/logging.h @@ -58,6 +58,7 @@ enum Level { void DumpStackTrace(); +QDebug CreateLoggerInfo(int line, const char *pretty_function, const char* category); QDebug CreateLoggerFatal(int line, const char *pretty_function, const char* category); QDebug CreateLoggerError(int line, const char *pretty_function, const char* category); @@ -68,10 +69,8 @@ QDebug CreateLoggerError(int line, const char *pretty_function, const char* cate #endif // QT_NO_WARNING_OUTPUT #ifdef QT_NO_DEBUG_OUTPUT - QNoDebug CreateLoggerInfo(int, const char*, const char*); QNoDebug CreateLoggerDebug(int, const char*, const char*); #else - QDebug CreateLoggerInfo(int line, const char *pretty_function, const char* category); QDebug CreateLoggerDebug(int line, const char *pretty_function, const char* category); #endif // QT_NO_DEBUG_OUTPUT