diff options
| author | steven-na <noreply.github@stvnc.dev> | 2026-08-14 04:04:33 -0700 |
|---|---|---|
| committer | steven-na <noreply.github@stvnc.dev> | 2026-08-14 04:04:33 -0700 |
| commit | 2f6e71222f347949786892803df431184fc61903 (patch) | |
| tree | c2b012093d8882c52423d4515caa920c0645ec29 /src/log.h | |
| parent | abc88dd876c9aab0690074fc29802ca99060b7a7 (diff) | |
Add log_init
Diffstat (limited to 'src/log.h')
| -rw-r--r-- | src/log.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,5 +1,4 @@ // Based on: https://github.com/rxi/log.c/ - #pragma once #include "common.h" @@ -25,11 +24,15 @@ typedef enum { #define log_error(...) log_log(LogLevelError, __FILE__, __LINE__, __VA_ARGS__) #define log_fatal(...) log_log(LogLevelFatal, __FILE__, __LINE__, __VA_ARGS__) -const char *log_get_level(); +// If this is not called, logging will have no effect. +// Most likely pass stdout or stderr +void log_init(FILE *out); void log_set_level(LogLevelE lvl); void log_set_quiet(b32 quiet); void log_set_lock(log_LockProc proc); void log_set_fp(FILE *log_file); +const char *log_get_level(); + void log_log(LogLevelE lvl, const char *src_file, u64 src_line, const char *fmt, ...); |