diff --git a/CMakeLists.txt b/CMakeLists.txt index fa40870bf..37e6654e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,12 +58,15 @@ option(BUILD_TESTS "Build Tomahawk with unit tests" ON) option(BUILD_HATCHET "Build the Hatchet plugin" OFF) option(BUILD_WITH_QT4 "Build Tomahawk with Qt4 no matter if Qt5 was found" ON) -option(SANITIZE_ADDRESS "Enable Address Sanitizer for memory error detection" OFF) option(WITH_CRASHREPORTER "Build with CrashReporter" ON) option(WITH_BINARY_ATTICA "Enable support for downloading binary resolvers automatically" ON) option(LEGACY_KDE_INTEGRATION "Install tomahawk.protocol file, deprecated since 4.6.0" OFF) option(WITH_KDE4 "Build with support for KDE specific stuff" ON) +# build options for development purposes +option(SANITIZE_ADDRESS "Enable Address Sanitizer for memory error detection" OFF) +option(TOMAHAWK_FINEGRAINED_MESSAGES "Enable even more verbose logging (will hurt performance significantly" OFF) + CMAKE_DEPENDENT_OPTION(WITH_UPOWER "Build with support for UPower events" ON "UNIX;NOT APPLE" OFF) CMAKE_DEPENDENT_OPTION(WITH_GNOMESHORTCUTHANDLER "Build with shortcut handler for GNOME" ON diff --git a/src/libtomahawk/utils/Logger.h b/src/libtomahawk/utils/Logger.h index 34916a515..14e90d920 100644 --- a/src/libtomahawk/utils/Logger.h +++ b/src/libtomahawk/utils/Logger.h @@ -22,6 +22,7 @@ #include #include "DllMacro.h" +#include "config.h" #define LOGDEBUG 1 #define LOGINFO 2 @@ -69,4 +70,12 @@ namespace Logger #define tSqlLog Logger::TSqlLog DLLEXPORT void tLogNotifyShutdown(); +// Macro for messages that severely hurt performance but are helpful +// in some cases for better debugging. +#ifdef TOMAHAWK_FINEGRAINED_MESSAGES + #define FINEGRAINED_MSG(a) tDebug( LOGVERBOSE ) << a ; +#else + #define FINEGRAINED_MSG(a) +#endif + #endif // TOMAHAWK_LOGGER_H diff --git a/src/tomahawk/Config.h.in b/src/tomahawk/Config.h.in index 996536ca0..f04bfa19f 100644 --- a/src/tomahawk/Config.h.in +++ b/src/tomahawk/Config.h.in @@ -22,4 +22,6 @@ #cmakedefine LIBLASTFM_FOUND #cmakedefine QCA2_FOUND +#cmakedefine TOMAHAWK_FINEGRAINED_MESSAGES + #endif // CONFIG_H_IN