Logging: Add a flag to specify the minimum log level

--log_level = (0=error, 1=warning, 2=info, 3=debug)
This commit is contained in:
DrChat
2017-03-24 16:28:41 -05:00
parent 92a4b90ed0
commit e699be0118
6 changed files with 85 additions and 41 deletions

View File

@@ -32,11 +32,13 @@ bool trace_enabled = true;
#define THREAD_MATCH \
(!TARGET_THREAD || thread_state->thread_id() == TARGET_THREAD)
#define IFLUSH()
#define IPRINT(s) \
if (trace_enabled && THREAD_MATCH) xe::LogLine('t', s)
#define IPRINT(s) \
if (trace_enabled && THREAD_MATCH) \
xe::LogLine(xe::LogLevel::LOG_LEVEL_DEBUG, 't', s)
#define DFLUSH()
#define DPRINT(...) \
if (trace_enabled && THREAD_MATCH) xe::LogLineFormat('t', __VA_ARGS__)
#define DPRINT(...) \
if (trace_enabled && THREAD_MATCH) \
xe::LogLineFormat(xe::LogLevel::LOG_LEVEL_DEBUG, 't', __VA_ARGS__)
uint32_t GetTracingMode() {
uint32_t mode = 0;