From c5a521af1ffec527d2286c854bc3687f4782a483 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 17 Nov 2018 03:27:46 +0100 Subject: [PATCH] Fix logging --- ext/libstrawberry-common/core/logging.cpp | 2 -- ext/libstrawberry-common/core/logging.h | 17 +++-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/ext/libstrawberry-common/core/logging.cpp b/ext/libstrawberry-common/core/logging.cpp index 64a1146af..1aac1e3be 100644 --- a/ext/libstrawberry-common/core/logging.cpp +++ b/ext/libstrawberry-common/core/logging.cpp @@ -263,7 +263,6 @@ void DumpStackTrace() { #endif } -#if 0 QDebug CreateLoggerFatal(int line, const char *class_name) { return qCreateLogger(line, class_name, Fatal); } QDebug CreateLoggerError(int line, const char *class_name) { return qCreateLogger(line, class_name, Error); } @@ -280,7 +279,6 @@ QNoDebug CreateLoggerDebug(int, const char*) { return QNoDebug(); } QDebug CreateLoggerInfo(int line, const char *class_name) { return qCreateLogger(line, class_name, Info); } QDebug CreateLoggerDebug(int line, const char *class_name) { return qCreateLogger(line, class_name, Debug); } #endif // QT_NO_DEBUG_OUTPUT -#endif } // namespace logging diff --git a/ext/libstrawberry-common/core/logging.h b/ext/libstrawberry-common/core/logging.h index 729746cd4..fb0d07370 100644 --- a/ext/libstrawberry-common/core/logging.h +++ b/ext/libstrawberry-common/core/logging.h @@ -27,22 +27,11 @@ #ifdef QT_NO_DEBUG_STREAM # define qLog(level) while (false) QNoDebug() #else -#define qLog(level) \ - logging::CreateLogger(logging::Level_##level, \ - logging::ParsePrettyFunction(__PRETTY_FUNCTION__), \ - __LINE__) +#define qLog(level) logging::CreateLogger##level(__LINE__, __PRETTY_FUNCTION__) + +#define qCreateLogger(line, class_name, level) logging::CreateLogger(logging::Level_##level, logging::ParsePrettyFunction(class_name), line) #endif // QT_NO_DEBUG_STREAM -#if 0 -#define qLog(level) \ - logging::CreateLogger##level(__LINE__, __PRETTY_FUNCTION__) - -#define qCreateLogger(line, class_name, level) \ - logging::CreateLogger(logging::Level_##level, \ - logging::ParsePrettyFunction(class_name), \ - line) -#endif - namespace logging { class NullDevice : public QIODevice { protected: