Skip to content

Commit

Permalink
log: backport missing LOG_ macro
Browse files Browse the repository at this point in the history
Fixes: daaefc0
Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed Oct 24, 2024
1 parent c216a9b commit ead088c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ enum log_level {
} \
} while (0)

#define LOG(level, x, ...) \
do { \
if (LOG_LEVEL_##level >= log_get_level_tls()) { \
log_printf(tls_logger, LOG_LEVEL_##level, __func__, x, ##__VA_ARGS__); \
} \
#define LOG_(level, x, ...) \
do { \
if (level >= log_get_level_tls()) { \
log_printf(tls_logger, level, __func__, x, ##__VA_ARGS__); \
} \
} while (0)
#define LOG(level, x, ...) LOG_(LOG_LEVEL_##level, x, ##__VA_ARGS__)
#define log_trace(x, ...) LOG_UNLIKELY(TRACE, x, ##__VA_ARGS__)
#define log_verbose(x, ...) LOG_UNLIKELY(VERBOSE, x, ##__VA_ARGS__)
#define log_debug(x, ...) LOG_UNLIKELY(DEBUG, x, ##__VA_ARGS__)
Expand Down

0 comments on commit ead088c

Please sign in to comment.