diff options
Diffstat (limited to 'log/include')
-rw-r--r-- | log/include/log/log.h | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/log/include/log/log.h b/log/include/log/log.h index c660881..f94ba84 100644 --- a/log/include/log/log.h +++ b/log/include/log/log.h | |||
@@ -10,24 +10,11 @@ | |||
10 | #undef LOGW | 10 | #undef LOGW |
11 | #undef LOGE | 11 | #undef LOGE |
12 | 12 | ||
13 | // __VA_OPT__ is not available until C2X. | 13 | #define LOG(channel, tag, ...) \ |
14 | /*#define LOG(channel, tag, format, ...) \ | 14 | { \ |
15 | { \ | 15 | fprintf(channel, "[%s] %s:%d", #tag, __FILE__, __LINE__); \ |
16 | fprintf( \ | 16 | fprintf(channel, " " __VA_ARGS__); \ |
17 | channel, "[%s] %s:%d " format "\n", #tag, __FILE__, \ | 17 | fprintf(channel, "\n"); \ |
18 | __LINE__ __VA_OPT__(, ) __VA_ARGS__); \ | ||
19 | }*/ | ||
20 | |||
21 | /*#define LOGD(format, ...) LOG(stdout, DEBUG, format, __VA_ARGS__) | ||
22 | #define LOGI(format, ...) LOG(stdout, INFO, format, __VA_ARGS__) | ||
23 | #define LOGW(format, ...) LOG(stdout, WARN, format, __VA_ARGS__) | ||
24 | #define LOGE(format, ...) LOG(stderr, ERROR, format, __VA_ARGS__)*/ | ||
25 | |||
26 | #define LOG(channel, tag, ...) \ | ||
27 | { \ | ||
28 | fprintf(channel, "[%s] %s:%d ", #tag, __FILE__, __LINE__); \ | ||
29 | fprintf(channel, __VA_ARGS__); \ | ||
30 | fprintf(channel, "\n"); \ | ||
31 | } | 18 | } |
32 | 19 | ||
33 | #define LOGD(...) LOG(stdout, DEBUG, __VA_ARGS__) | 20 | #define LOGD(...) LOG(stdout, DEBUG, __VA_ARGS__) |