diff options
| author | 3gg <3gg@shellblade.net> | 2024-09-16 08:50:50 -0700 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2024-09-16 08:50:50 -0700 |
| commit | b540364f3842fe6ea41a908c905e12e4458e4fef (patch) | |
| tree | c33cb2f37af0901091306c97f5164b18fe297221 /log/include | |
| parent | 448343bc6f092e0dd08591d97007034533fb473b (diff) | |
Fix warnings.
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__) |
