C
You're viewing a free preview. Sign in free to read every script.
Why this exists Every long running tool needs logs, and printf scattered through the code is not logging: no timestamps, no severity, no way to turn debug noise off in production. A good logger is small in C, and…
Variadic Functions and a Leveled UTC Logger: va_list, vfprintf and Format Checking
Write your own printf-style function with va_list, then use it to build a small logging library with levels, UTC timestamps, file and line, a LOG_LEVEL environment variable and a clock you can replace in tests.
Sign in free to read this script, along with the rest of the library.
Sign in free