#include #include int main(void) { struct SlogHandlerOpts opts1 = { .File = stdout, .MinLevel = SlogLevelDebug, .Prefix = NULL, .AddSource = true, .Json = false, }; struct SlogLogger l1 = { SlogTextHandler, opts1, }; struct SlogHandlerOpts opts2 = { .File = stderr, .MinLevel = SlogLevelError, .Prefix = "scope", .AddSource = false, .Json = true, }; struct SlogLogger l2 = { SlogTextHandler, opts2, }; struct SlogAttr attrs[] = { SlogAttrB("ok", true), }; SLOG_INFO_ATTRS(&l1, "hello", attrs); // stdout: // time=2025-09-30T09:38:32.607139416-06:00 level=INFO msg=hello source=tests/slog.c:36 func=main ok=true SLOG_ERROR(&l2, "hello"); // stderr: // time=2025-09-30T09:38:32.607139416-06:00 level=INFO msg=hello return 0; }