20 lines
434 B
C
20 lines
434 B
C
#include <slog/slog.h>
|
|
#include <stdbool.h>
|
|
|
|
int main(void)
|
|
{
|
|
struct SlogLogger logger = SLOG_DEFAULT_TEXT_LOGGER;
|
|
|
|
struct SlogAttr attrs[] = {
|
|
SlogAttrB("ok", true),
|
|
};
|
|
|
|
SLOG_INFO(&logger, "hello", attrs);
|
|
// time=2025-09-29T17:46:49.409721457-06:00 level=INFO msg=hello ok=true
|
|
|
|
// SLOG_INFO(&logger, "hello", NULL);
|
|
// Warning: size of pointer is divided by size of pointed type
|
|
// but still could be used.
|
|
|
|
return 0;
|
|
}
|