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


Go to the source code of this file.
Classes | |
| struct | LogEvent |
| 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 LogLevel | LogLevel |
| The severity level of a log message. | |
| typedef struct LogEvent | LogEvent |
| A structured event containing all metadata for a single log message. | |
| typedef void(* | LogFn) (LogEvent *ev, void *user_data) |
| Signature for custom logging destination callbacks. | |
| typedef void(* | LogLockFn) (void *user_data, b32 lock) |
| Signature for the thread-synchronization callback. | |
Enumerations | |
| enum | LogLevel { LOG_LEVEL_TRACE , LOG_LEVEL_DEBUG , LOG_LEVEL_INFO , LOG_LEVEL_WARN , LOG_LEVEL_ERROR , LOG_LEVEL_FATAL , LOG_LEVEL_COUNT } |
| The severity level of a log message. More... | |
Functions | |
| void | log_set_level (LogLevel level) |
| Configures the active logging level. Messages below this level are ignored. | |
| void | log_set_quiet (b32 enable) |
| Mutes or unmutes all console (stdout/stderr) output. | |
| void | log_set_lock (LogLockFn fn, void *user_data) |
| Configures thread-safety by providing a custom locking mechanism. | |
| b32 | log_add_fp (FILE *fp, LogLevel min_level) |
| Adds a standard C FILE* pointer as a logging destination. | |
| b32 | log_add_callback (LogFn fn, void *user_data, LogLevel min_level) |
| Adds a custom callback function as a logging destination. | |
| void | log_message (LogLevel 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 120 of file base_log.h.
| #define LOG_ERROR | ( | ... | ) |
Logs an ERROR level message (Recoverable operation failures).
Definition at line 126 of file base_log.h.
| #define LOG_FATAL | ( | ... | ) |
Logs a FATAL level message (Critical crash or shutdown).
Definition at line 128 of file base_log.h.
| #define LOG_INFO | ( | ... | ) |
Logs an INFO level message (General application flow).
Definition at line 122 of file base_log.h.
| #define LOG_TRACE | ( | ... | ) |
Logs a TRACE level message (Fine-grained step-by-step debug info).
Definition at line 118 of file base_log.h.
| #define LOG_WARN | ( | ... | ) |
Logs a WARN level message (Abnormal but non-fatal).
Definition at line 124 of file base_log.h.