From 228843c43e21ce4d3ca5fe0adc96fcb34505446b Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 10 Jan 2015 13:07:50 -0800 Subject: Logging: Log all called service functions (under trace). Compile out all trace logs under release for performance. --- src/common/common.h | 7 ------- src/common/log.h | 2 +- src/common/logging/log.h | 23 +++++++---------------- 3 files changed, 8 insertions(+), 24 deletions(-) (limited to 'src/common') diff --git a/src/common/common.h b/src/common/common.h index bf48ae667..3246c7797 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -11,13 +11,6 @@ #include #include -// Force enable logging in the right modes. For some reason, something had changed -// so that debugfast no longer logged. -#if defined(_DEBUG) || defined(DEBUGFAST) -#undef LOGGING -#define LOGGING 1 -#endif - #define STACKALIGN // An inheritable class to disallow the copy constructor and operator= functions diff --git a/src/common/log.h b/src/common/log.h index 667f2fbb9..b397cf14d 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -14,7 +14,7 @@ #endif #endif -#if _DEBUG +#ifdef _DEBUG #define _dbg_assert_(_t_, _a_) \ if (!(_a_)) {\ LOG_CRITICAL(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \ diff --git a/src/common/logging/log.h b/src/common/logging/log.h index bda3d633a..3d94bf0d9 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -73,17 +73,6 @@ enum class Class : ClassType { Count ///< Total number of logging classes }; -/** - * Level below which messages are simply discarded without buffering regardless of the display - * settings. - */ -const Level MINIMUM_LEVEL = -#ifdef _DEBUG - Level::Trace; -#else - Level::Debug; -#endif - /** * Logs a message to the global logger. This proxy exists to avoid exposing the details of the * Logger class, including the ConcurrentRingBuffer template, to all files that desire to log @@ -103,13 +92,15 @@ void LogMessage(Class log_class, Level log_level, } // namespace Log #define LOG_GENERIC(log_class, log_level, ...) \ - do { \ - if (::Log::Level::log_level >= ::Log::MINIMUM_LEVEL) \ - ::Log::LogMessage(::Log::Class::log_class, ::Log::Level::log_level, \ - __FILE__, __LINE__, __func__, __VA_ARGS__); \ - } while (0) + ::Log::LogMessage(::Log::Class::log_class, ::Log::Level::log_level, \ + __FILE__, __LINE__, __func__, __VA_ARGS__) +#ifdef _DEBUG #define LOG_TRACE( log_class, ...) LOG_GENERIC(log_class, Trace, __VA_ARGS__) +#else +#define LOG_TRACE( log_class, ...) (void(0)) +#endif + #define LOG_DEBUG( log_class, ...) LOG_GENERIC(log_class, Debug, __VA_ARGS__) #define LOG_INFO( log_class, ...) LOG_GENERIC(log_class, Info, __VA_ARGS__) #define LOG_WARNING( log_class, ...) LOG_GENERIC(log_class, Warning, __VA_ARGS__) -- cgit v1.2.3