54 LOG_INFO(
"This should be ignored entirely");
static void lock(void)
Acquires the logger lock if a locking function is configured.
Professional, thread-safe, leveled logging system.
#define LOG_INFO(...)
Logs an INFO level message (General application flow).
#define LOG_ERROR(...)
Logs an ERROR level message (Recoverable operation failures).
void log_set_level(LogLevel level)
Configures the active logging level. Messages below this level are ignored.
void log_set_lock(LogLockFn fn, void *user_data)
Configures thread-safety by providing a custom locking mechanism.
LogLevel
The severity level of a log message.
b32 log_add_callback(LogFn fn, void *user_data, LogLevel min_level)
Adds a custom callback function as a logging destination.
void log_set_quiet(b32 enable)
Mutes or unmutes all console (stdout/stderr) output.
A structured event containing all metadata for a single log message.
A lightweight, dependency-free unit testing harness.
#define EXPECT(cond)
Evaluates a condition. If it fails, prints the file/line and increments the fail count.
#define TEST_CASE(name)
Defines a test case function.
static LogLevel last_level
static void test_log_callback(LogEvent *ev, void *user_data)
static void test_lock_fn(void *user_data, b32 lock)
static char last_msg[256]