
Radikant Log is a logging library that utilizes preprocessor macros to fully strip log calls at compile time for zero-overhead production builds. It features thread-safe writing to both console and files with rich formatting, hex dumps, and flexible support for both global singletons and isolated logging contexts.
int main() {
rlog_init_global_file("app.log");
log_info("Application started");
log_success("Database connected");
log_error("Failed to load configuration file");
log_failure("Unhandled exception occurred");
log_alert("System resources critically low");
log_warning("Deprecated API usage detected");
return 0;
}
If not enabled all logging macros expand to empty loops and will be removed from the binary.
Filter debug messages at runtime to prevent verbose screen
Abstracts mutex locking to ensure log messages don't get scrambled when accessed by multiple threads.
Define Log Levels, the macros will remove unused logging functions from runtime.
Use context instances, allow different parts of your program to have different log levels.
Log to one ore more files as astream simultaneously and independentily withouth any issues
g_net_ctx = rlog_create_context("/Users/charrlie/Desktop/network.log", RLOG_SEV_ALL);
g_db_ctx = rlog_create_context("/Users/charrlie/Desktop/database.log", RLOG_SEV_ALL);
clog_info(g_net_ctx, "Interface initialization complete.");
clog_warning(g_net_ctx, "High latency detected on port 8080.");
clog_failure(g_net_ctx, "High cpu usage detected on remote 2");
clog_error(g_net_ctx, "Connection 2 is lost");
clog_info(g_db_ctx, "Transaction started for user ID 10.");
clog_error(g_db_ctx, "SQL insert failed: Duplicate key.");
clog_error(g_db_ctx, "SQL select failed: Schema error 1015.");
clog_failure(g_db_ctx, "Schema auth is corrupted, aborting.");