summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/common.h7
-rw-r--r--src/common/log.h2
-rw-r--r--src/common/logging/log.h23
3 files changed, 8 insertions, 24 deletions
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 @@
11#include <cstdio> 11#include <cstdio>
12#include <cstring> 12#include <cstring>
13 13
14// Force enable logging in the right modes. For some reason, something had changed
15// so that debugfast no longer logged.
16#if defined(_DEBUG) || defined(DEBUGFAST)
17#undef LOGGING
18#define LOGGING 1
19#endif
20
21#define STACKALIGN 14#define STACKALIGN
22 15
23// An inheritable class to disallow the copy constructor and operator= functions 16// 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 @@
14#endif 14#endif
15#endif 15#endif
16 16
17#if _DEBUG 17#ifdef _DEBUG
18#define _dbg_assert_(_t_, _a_) \ 18#define _dbg_assert_(_t_, _a_) \
19 if (!(_a_)) {\ 19 if (!(_a_)) {\
20 LOG_CRITICAL(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \ 20 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
@@ -74,17 +74,6 @@ enum class Class : ClassType {
74}; 74};
75 75
76/** 76/**
77 * Level below which messages are simply discarded without buffering regardless of the display
78 * settings.
79 */
80const Level MINIMUM_LEVEL =
81#ifdef _DEBUG
82 Level::Trace;
83#else
84 Level::Debug;
85#endif
86
87/**
88 * Logs a message to the global logger. This proxy exists to avoid exposing the details of the 77 * Logs a message to the global logger. This proxy exists to avoid exposing the details of the
89 * Logger class, including the ConcurrentRingBuffer template, to all files that desire to log 78 * Logger class, including the ConcurrentRingBuffer template, to all files that desire to log
90 * messages, reducing unecessary recompilations. 79 * messages, reducing unecessary recompilations.
@@ -103,13 +92,15 @@ void LogMessage(Class log_class, Level log_level,
103} // namespace Log 92} // namespace Log
104 93
105#define LOG_GENERIC(log_class, log_level, ...) \ 94#define LOG_GENERIC(log_class, log_level, ...) \
106 do { \ 95 ::Log::LogMessage(::Log::Class::log_class, ::Log::Level::log_level, \
107 if (::Log::Level::log_level >= ::Log::MINIMUM_LEVEL) \ 96 __FILE__, __LINE__, __func__, __VA_ARGS__)
108 ::Log::LogMessage(::Log::Class::log_class, ::Log::Level::log_level, \
109 __FILE__, __LINE__, __func__, __VA_ARGS__); \
110 } while (0)
111 97
98#ifdef _DEBUG
112#define LOG_TRACE( log_class, ...) LOG_GENERIC(log_class, Trace, __VA_ARGS__) 99#define LOG_TRACE( log_class, ...) LOG_GENERIC(log_class, Trace, __VA_ARGS__)
100#else
101#define LOG_TRACE( log_class, ...) (void(0))
102#endif
103
113#define LOG_DEBUG( log_class, ...) LOG_GENERIC(log_class, Debug, __VA_ARGS__) 104#define LOG_DEBUG( log_class, ...) LOG_GENERIC(log_class, Debug, __VA_ARGS__)
114#define LOG_INFO( log_class, ...) LOG_GENERIC(log_class, Info, __VA_ARGS__) 105#define LOG_INFO( log_class, ...) LOG_GENERIC(log_class, Info, __VA_ARGS__)
115#define LOG_WARNING( log_class, ...) LOG_GENERIC(log_class, Warning, __VA_ARGS__) 106#define LOG_WARNING( log_class, ...) LOG_GENERIC(log_class, Warning, __VA_ARGS__)