240#define LOG_TRACE(...) base_log_message(BASE_LOG_LEVEL_TRACE, __FILE__, __LINE__, __VA_ARGS__)
242#define LOG_DEBUG(...) base_log_message(BASE_LOG_LEVEL_DEBUG, __FILE__, __LINE__, __VA_ARGS__)
244#define LOG_INFO(...) base_log_message(BASE_LOG_LEVEL_INFO, __FILE__, __LINE__, __VA_ARGS__)
246#define LOG_WARN(...) base_log_message(BASE_LOG_LEVEL_WARN, __FILE__, __LINE__, __VA_ARGS__)
248#define LOG_ERROR(...) base_log_message(BASE_LOG_LEVEL_ERROR, __FILE__, __LINE__, __VA_ARGS__)
250#define LOG_FATAL(...) base_log_message(BASE_LOG_LEVEL_FATAL, __FILE__, __LINE__, __VA_ARGS__)
static void lock(void)
Acquires the logger lock if a locking function is configured.
Context detection, compiler abstractions, utility macros, and data structures.
Core fixed-width type aliases and memory size constants.
#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 base_log_add_fp(FILE *fp, BaseLogLevel min_level)
Adds a standard C FILE* pointer as a logging destination.
void base_log_set_quiet(b32 enable)
Mutes or unmutes all console (stdout/stderr) output.
void base_log_message(BaseLogLevel level, const char *file, int line, const char *fmt,...)
Internal function that actually processes the log. DO NOT call directly.
b32 base_log_remove_callback(BaseLogFn fn)
Removes a previously registered callback from the logger.
void base_log_set_lock(BaseLogLockFn fn, void *user_data)
Configures thread-safety by providing a custom locking mechanism.
void(* BaseLogLockFn)(void *user_data, b32 lock)
Signature for the thread-synchronization callback.
void base_log_set_level(BaseLogLevel level)
Configures the active logging level. Messages below this level are ignored.
b32 base_log_add_callback(BaseLogFn fn, void *user_data, BaseLogLevel min_level)
Adds a custom callback function as a logging destination.
void(* BaseLogFn)(BaseLogEvent *ev, void *user_data)
Signature for custom logging destination callbacks.
BaseLogLevel
The severity level of a log message.
A structured event containing all metadata for a single log message.