diff options
Diffstat (limited to 'include/log.h')
-rw-r--r-- | include/log.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/log.h b/include/log.h index 2be35ee..c4a2430 100644 --- a/include/log.h +++ b/include/log.h @@ -29,27 +29,27 @@ void log_set_verbosity(enum log_level); void log_printf(enum log_level, const char *restrict fmt, ...); #ifdef DEBUG -#define log_print(v, fmt, ...) \ +#define log_print(v, fmt, ...) \ log_printf(v, "[%s] %s:%d " fmt, log_level_names[v], \ - __FILE__, __LINE__, ##__VA_ARGS__) + __FILE__, __LINE__, ##__VA_ARGS__) #else #define log_print(v, fmt, ...) \ log_printf(v, fmt, ##__VA_ARGS__) #endif #ifdef DEBUG -#define log_printl(v, fmt, ...) \ +#define log_printl(v, fmt, ...) \ log_printf(v, "[%s] %s:%d " fmt "\n", log_level_names[v], \ - __FILE__, __LINE__, ##__VA_ARGS__) + __FILE__, __LINE__, ##__VA_ARGS__) #else #define log_printl(v, fmt, ...) \ log_printf(v, fmt "\n", ##__VA_ARGS__) #endif #ifdef DEBUG -#define log_printl_errno(v, fmt, ...) \ +#define log_printl_errno(v, fmt, ...) \ log_printf(v, "[%s] %s:%d " fmt ": %s\n", log_level_names[v], \ - __FILE__, __LINE__, ##__VA_ARGS__, strerror(errno)) + __FILE__, __LINE__, ##__VA_ARGS__, strerror(errno)) #else #define log_printl_errno(v, fmt, ...) \ log_printf(v, fmt ": %s\n", ##__VA_ARGS__, strerror(errno)) |