formatting shit

This commit is contained in:
2026-05-11 10:26:30 +00:00
parent 5b8708ad0c
commit c26ccba813
13 changed files with 259 additions and 219 deletions

View File

@@ -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)