|
|
#define | STRINGIFY(x) #x |
| |
|
#define | TOSTRING(x) STRINGIFY(x) |
| |
|
#define | __FILE_LINE__ __FILE__ " (" TOSTRING(__LINE__) ")" |
| |
|
#define | __FILENAME_LINE__ (strrchr(__FILE__, '/') ? strrchr(__FILE_LINE__, '/') + 1 : __FILE_LINE__) |
| |
|
#define | __FUNC__ "" |
| |
|
#define | va_num_args(...) va_num_args_impl(__VA_ARGS__, 5,4,3,2,1) |
| |
|
#define | va_num_args_impl(_1, _2, _3, _4, _5, N, ...) N |
| |
|
#define | macro_dispatcher(func, ...) macro_dispatcher_(func, va_num_args(__VA_ARGS__)) |
| |
|
#define | macro_dispatcher_(func, nargs) macro_dispatcher__(func, nargs) |
| |
|
#define | macro_dispatcher__(func, nargs) func ## nargs |
| |
|
#define | __LOG_LOCATION vmcmc::Logger::Location(__FILE__, __FUNC__, __LINE__) |
| |
|
#define | __LOG_DEFINE_2(I, K) static vmcmc::Logger I(K); |
| |
|
#define | __LOG_DEFINE_1(K) static vmcmc::Logger sLocalLoggerInstance(K); |
| |
| #define | __LOG_3(I, L, M) |
| |
| #define | __LOG_ONCE_3(I, L, M) |
| |
| #define | __LOG_ASSERT_3(I, C, M) |
| |
|
#define | __LOG_2(L, M) __LOG_3(sLocalLoggerInstance,L,M) |
| |
|
#define | __LOG_1(M) __LOG_3(sLocalLoggerInstance,Debug,M) |
| |
|
#define | __LOG_ONCE_2(L, M) __LOG_ONCE_3(sLocalLoggerInstance,L,M) |
| |
|
#define | __LOG_ONCE_1(M) __LOG_ONCE_3(sLocalLoggerInstance,Debug,M) |
| |
|
#define | __LOG_ASSERT_1(C) __LOG_ASSERT_3(sLocalLoggerInstance,C,"") |
| |
|
#define | __LOG_ASSERT_2(C, M) __LOG_ASSERT_3(sLocalLoggerInstance,C,M) |
| |
|
#define | LOG_DEFINE(...) macro_dispatcher(__LOG_DEFINE_, __VA_ARGS__)(__VA_ARGS__) |
| |
|
#define | LOG(...) macro_dispatcher(__LOG_, __VA_ARGS__)(__VA_ARGS__) |
| |
|
#define | LOG_ONCE(...) macro_dispatcher(__LOG_ONCE_, __VA_ARGS__)(__VA_ARGS__) |
| |
|
#define | LOG_ASSERT(...) macro_dispatcher(__LOG_ASSERT_, __VA_ARGS__)(__VA_ARGS__) |
| |
Class definitions and MACROs for logging purposes.
- Copyright
- Copyright 2016 Marco Kleesiek. Released under the GNU Lesser General Public License v3.
- Date
- 25.07.2016
- Author
- marco.nosp@m.@kle.nosp@m.esiek.nosp@m..com