|
cbase 1.50.0
C/C++ Static Template
|
Professional, thread-safe, leveled logging system. More...


Go to the source code of this file.
Classes | |
| struct | BaseLogEvent |
| A structured event containing all metadata for a single log message. More... | |
Macros | |
| #define | LOG_TRACE(...) |
| Logs a TRACE level message (Fine-grained step-by-step debug info). | |
| #define | LOG_DEBUG(...) |
| Logs a DEBUG level message (Diagnostic info). | |
| #define | LOG_INFO(...) |
| Logs an INFO level message (General application flow). | |
| #define | LOG_WARN(...) |
| Logs a WARN level message (Abnormal but non-fatal). | |
| #define | LOG_ERROR(...) |
| Logs an ERROR level message (Recoverable operation failures). | |
| #define | LOG_FATAL(...) |
| Logs a FATAL level message (Critical crash or shutdown). | |
Typedefs | |
| typedef enum BaseLogLevel | BaseLogLevel |
| The severity level of a log message. | |
| typedef struct BaseLogEvent | BaseLogEvent |
| A structured event containing all metadata for a single log message. | |
| typedef void(* | BaseLogFn) (BaseLogEvent *ev, void *user_data) |
| Signature for custom logging destination callbacks. | |
| typedef void(* | BaseLogLockFn) (void *user_data, b32 lock) |
| Signature for the thread-synchronization callback. | |
Enumerations | |
| enum | BaseLogLevel { BASE_LOG_LEVEL_TRACE , BASE_LOG_LEVEL_DEBUG , BASE_LOG_LEVEL_INFO , BASE_LOG_LEVEL_WARN , BASE_LOG_LEVEL_ERROR , BASE_LOG_LEVEL_FATAL , BASE_LOG_LEVEL_COUNT } |
| The severity level of a log message. More... | |
Functions | |
| void | base_log_set_level (BaseLogLevel level) |
| Configures the active logging level. Messages below this level are ignored. | |
| void | base_log_set_quiet (b32 enable) |
| Mutes or unmutes all console (stdout/stderr) output. | |
| void | base_log_set_lock (BaseLogLockFn fn, void *user_data) |
| Configures thread-safety by providing a custom locking mechanism. | |
| b32 | base_log_add_fp (FILE *fp, BaseLogLevel min_level) |
| Adds a standard C FILE* pointer as a logging destination. | |
| b32 | base_log_add_callback (BaseLogFn fn, void *user_data, BaseLogLevel min_level) |
| Adds a custom callback function as a logging destination. | |
| b32 | base_log_remove_callback (BaseLogFn fn) |
| Removes a previously registered callback from the logger. | |
| 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. | |
Professional, thread-safe, leveled logging system.
Features multiple sinks (console, files, callbacks), thread-safety via custom locks, and zero-overhead debug logging in release builds.
Definition in file base_log.h.
| #define LOG_DEBUG | ( | ... | ) |
Logs a DEBUG level message (Diagnostic info).
Definition at line 242 of file base_log.h.
| #define LOG_ERROR | ( | ... | ) |
Logs an ERROR level message (Recoverable operation failures).
Definition at line 248 of file base_log.h.
| #define LOG_FATAL | ( | ... | ) |
Logs a FATAL level message (Critical crash or shutdown).
Definition at line 250 of file base_log.h.
| #define LOG_INFO | ( | ... | ) |
Logs an INFO level message (General application flow).
Definition at line 244 of file base_log.h.
| #define LOG_TRACE | ( | ... | ) |
Logs a TRACE level message (Fine-grained step-by-step debug info).
Definition at line 240 of file base_log.h.
| #define LOG_WARN | ( | ... | ) |
Logs a WARN level message (Abnormal but non-fatal).
Definition at line 246 of file base_log.h.