10 LOG_INFO(
"Application started successfully.");
11 LOG_DEBUG(
"Memory arena initialized with %d MB.", 512);
15 LOG_WARN(
"Configuration file '%.*s' not found, using defaults.",
STR8_FMT(file_name));
18 FILE *log_file = fopen(
"app.log",
"a");
21 LOG_INFO(
"This message will go to both the console AND the file!");
Professional, thread-safe, leveled logging system.
#define LOG_INFO(...)
Logs an INFO level message (General application flow).
#define LOG_DEBUG(...)
Logs a DEBUG level message (Diagnostic info).
#define LOG_WARN(...)
Logs a WARN level message (Abnormal but non-fatal).
Context detection, utilities, compiler abstractions, and data structures.
Sized string (string slice) definitions and helper macros.
Core type definitions and fixed-width aliases.
b32 log_add_fp(FILE *fp, LogLevel min_level)
Adds a standard C FILE* pointer as a logging destination.
#define STR8_FMT(s)
Helper macro to use a String8 in a printf-style format string. Example:
#define STR8(s)
Wraps a C string literal into a String8 struct at compile time.
High-performance Virtual Memory Linear (Arena) Allocator.
A sized UTF-8 string slice.