-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogging.h
More file actions
40 lines (31 loc) · 1.34 KB
/
Logging.h
File metadata and controls
40 lines (31 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef CHANNELING_LOGGING_H_
#define CHANNELING_LOGGING_H_
#include <spdlog/spdlog.h>
// These wrapper macros are here to ensure that the arguments to logging
// functions aren't being resolved before actually knowing if they will be
// used.
#define LOG_TRACE(...) \
if (not (spdlog::default_logger_raw()->level() > spdlog::level::trace)) { \
spdlog::trace(__VA_ARGS__); \
}
#define LOG_DEBUG(...) \
if (not (spdlog::default_logger_raw()->level() > spdlog::level::debug)) { \
spdlog::debug(__VA_ARGS__); \
}
#define LOG_INFO(...) \
if (not (spdlog::default_logger_raw()->level() > spdlog::level::info)) { \
spdlog::info(__VA_ARGS__); \
}
#define LOG_WARN(...) \
if (not (spdlog::default_logger_raw()->level() > spdlog::level::warn)) { \
spdlog::warn(__VA_ARGS__); \
}
#define LOG_ERROR(...) \
if (not (spdlog::default_logger_raw()->level() > spdlog::level::err)) { \
spdlog::error(__VA_ARGS__); \
}
#define LOG_CRITICAL(...) \
if (not (spdlog::default_logger_raw()->level() > spdlog::level::critical)) { \
spdlog::critical(__VA_ARGS__); \
}
#endif // CHANNELING_LOGGING_H_