118#define LOG_TRACE(...) log_message(LOG_LEVEL_TRACE, __FILE__, __LINE__, __VA_ARGS__)
120#define LOG_DEBUG(...) log_message(LOG_LEVEL_DEBUG, __FILE__, __LINE__, __VA_ARGS__)
122#define LOG_INFO(...) log_message(LOG_LEVEL_INFO, __FILE__, __LINE__, __VA_ARGS__)
124#define LOG_WARN(...) log_message(LOG_LEVEL_WARN, __FILE__, __LINE__, __VA_ARGS__)
126#define LOG_ERROR(...) log_message(LOG_LEVEL_ERROR, __FILE__, __LINE__, __VA_ARGS__)
128#define LOG_FATAL(...) log_message(LOG_LEVEL_FATAL, __FILE__, __LINE__, __VA_ARGS__)
static void lock(void)
Acquires the logger lock if a locking function is configured.
Context detection, utilities, compiler abstractions, and data structures.
Core type definitions and fixed-width aliases.
#define C_LINKAGE_END
Closes a C linkage block for C++ compilers (Empty in C).
#define C_LINKAGE_BEGIN
Opens a C linkage block for C++ compilers (Empty in C).
b32 log_add_fp(FILE *fp, LogLevel min_level)
Adds a standard C FILE* pointer as a logging destination.
void log_set_level(LogLevel level)
Configures the active logging level. Messages below this level are ignored.
void(* LogLockFn)(void *user_data, b32 lock)
Signature for the thread-synchronization callback.
void log_set_lock(LogLockFn fn, void *user_data)
Configures thread-safety by providing a custom locking mechanism.
void log_message(LogLevel level, const char *file, int line, const char *fmt,...)
Internal function that actually processes the log. DO NOT call directly.
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(* LogFn)(LogEvent *ev, void *user_data)
Signature for custom logging destination callbacks.
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.