formatting shit
This commit is contained in:
@@ -15,25 +15,25 @@
|
||||
#include <stdarg.h>
|
||||
|
||||
typedef enum {
|
||||
LOG_INF,
|
||||
LOG_WRN,
|
||||
LOG_ERR,
|
||||
LOG_DBG,
|
||||
LOG_START,
|
||||
LOG_INF,
|
||||
LOG_WRN,
|
||||
LOG_ERR,
|
||||
LOG_DBG,
|
||||
LOG_START,
|
||||
} log_level_t;
|
||||
|
||||
/* __PRETTY_FUNCTION__ is a GCC/Clang extension that gives the full
|
||||
s ignature: "voi*d foo(int x)" — same thing source_location gave you.
|
||||
Falls back to plain __func__ (C99) if somehow unavailable. */
|
||||
#define applog(level, fmt, ...) \
|
||||
log_write(level, __PRETTY_FUNCTION__, fmt, ##__VA_ARGS__)
|
||||
log_write(level, __PRETTY_FUNCTION__, fmt, ##__VA_ARGS__)
|
||||
|
||||
/* format attribute gives compile-time printf format checking —
|
||||
better than wha*t std::format gave you at runtime */
|
||||
void log_write(log_level_t level, const char *func, const char *fmt, ...)
|
||||
__attribute__((format(printf, 3, 4)));
|
||||
__attribute__((format(printf, 3, 4)));
|
||||
|
||||
#else /* APPLOG_ENABLED not defined */
|
||||
#else /* APPLOG_ENABLED not defined */
|
||||
|
||||
#define applog(...) ((void)0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user