AtlatestRenderedmarkdown
Readme
sigil-log
Structured logging for Sigil.
Provides configurable log levels, text and JSON output formats, per-module filtering, and lazy macros that skip evaluation when the level is inactive.
This package was extracted from the sigil monorepo — the in-tree history under packages/sigil-log/ is preserved here as master.
Usage
(import (sigil log))
(log-info "Server started" port: 8080)
(log-warn "Slow query" duration-ms: 1200)
(log-error "Request failed" path: "/api" status: 500)
;; Switch output format, raise/lower level
(log-configure! level: 'debug format: 'json)
;; Lazy macros — the argument expressions are not evaluated if the
;; current level suppresses the call site.
(log-debug* "result" value: (expensive-computation))API
(sigil log)
| Procedure / macro | Purpose |
|---|---|
log-configure! | Set level, format, output target |
log-configure-from-args! | Parse --log-level / --log-format from a CLI argv |
log-trace / log-debug / log-info / log-warn / log-error / log-fatal | Emit at level |
log-trace* / log-debug* / log-info* / log-warn* / log-error* / log-fatal* | Lazy variants — skip argument evaluation when level inactive |
log-level-active? | Query whether a level would be emitted |
current-log-level | Return the currently configured level |
Levels, low to high: trace, debug, info, warn, error, fatal.
Dependencies
sigil-stdlibsigil-json
Both are workspace siblings in the sigil monorepo and are consumed here as from-git refs pinned to ^0.13.0.
Build
sigil deps install
sigil buildTesting
sigil testLicense
BSD-3-Clause.