Commit44aa809aRecorded24 Apr 2026Repositorysigil-log
Extract sigil-log from sigil monorepo
Message
This is the reference migration for the sigil-ecosystem modularization effort: sigil-log is the smallest / simplest candidate and serves as the template for subsequent extractions (sigil-http, sigil-json, sigil-mcp, ...).
The prior packages/sigil-log/ history in the monorepo is preserved here at the repo root via git filter-repo --path-rename. On top of that history this commit adds:
- README.md - standalone-repo usage, API summary, build/test, license
- .gitignore - build/ and .sigil/
- manifest.scm - minimal guix-shell (pure-Scheme pkg, no vendored C)
- dev-redirects.sgl - point codeberg:sigil/sigil at ../sigil checkout
- package.sgl - explicit version "0.13.0", url flipped to codeberg.org/sigil/sigil-log,
from-workspacedeps on sigil-stdlib and sigil-json converted tofrom-gitrefs pinned to ^0.13.0 - sigil.lock -
sigil deps installoutput, both deps resolve to v0.13.1
Verified: sigil build clean, sigil test 25/25 passing.
The playbook distilled from this extraction lives in folio at procedures/sigil-package-extraction.
Changed
.gitignore | 2 ++
README.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
dev-redirects.sgl | 6 ++++++
manifest.scm | 10 ++++++++++
package.sgl | 7 ++++---
sigil.lock | 13 +++++++++++++
6 files changed, 101 insertions(+), 3 deletions(-)Diff
.gitignoreadded
@@ -0,0 +1,2 @@
+1
build/+2
.sigil/README.mdadded
@@ -0,0 +1,66 @@
+1
# sigil-log+2
+3
Structured logging for [Sigil](https://codeberg.org/sigil/sigil).+4
+5
Provides configurable log levels, text and JSON output formats, per-module+6
filtering, and lazy macros that skip evaluation when the level is inactive.+7
+8
This package was extracted from the sigil monorepo — the in-tree history+9
under `packages/sigil-log/` is preserved here as `master`.+10
+11
## Usage+12
+13
```scheme+14
(import (sigil log))+15
+16
(log-info "Server started" port: 8080)+17
(log-warn "Slow query" duration-ms: 1200)+18
(log-error "Request failed" path: "/api" status: 500)+19
+20
;; Switch output format, raise/lower level+21
(log-configure! level: 'debug format: 'json)+22
+23
;; Lazy macros — the argument expressions are not evaluated if the+24
;; current level suppresses the call site.+25
(log-debug* "result" value: (expensive-computation))+26
```+27
+28
## API+29
+30
### `(sigil log)`+31
+32
| Procedure / macro | Purpose |+33
|-------------------|---------|+34
| `log-configure!` | Set level, format, output target |+35
| `log-configure-from-args!` | Parse `--log-level` / `--log-format` from a CLI argv |+36
| `log-trace` / `log-debug` / `log-info` / `log-warn` / `log-error` / `log-fatal` | Emit at level |+37
| `log-trace*` / `log-debug*` / `log-info*` / `log-warn*` / `log-error*` / `log-fatal*` | Lazy variants — skip argument evaluation when level inactive |+38
| `log-level-active?` | Query whether a level would be emitted |+39
| `current-log-level` | Return the currently configured level |+40
+41
Levels, low to high: `trace`, `debug`, `info`, `warn`, `error`, `fatal`.+42
+43
## Dependencies+44
+45
- `sigil-stdlib`+46
- `sigil-json`+47
+48
Both are workspace siblings in the sigil monorepo and are consumed here+49
as `from-git` refs pinned to `^0.13.0`.+50
+51
## Build+52
+53
```sh+54
sigil deps install+55
sigil build+56
```+57
+58
## Testing+59
+60
```sh+61
sigil test+62
```+63
+64
## License+65
+66
BSD-3-Clause.dev-redirects.sgladded
@@ -0,0 +1,6 @@
+1
;; Development redirects — point dependencies at local Sigil checkout+2
(redirects+3
repos: (list+4
(for-repo+5
url: "codeberg:sigil/sigil"+6
use: (from-path dir: "../sigil"))))manifest.scmadded
@@ -0,0 +1,10 @@
+1
;; sigil-log Development Environment+2
;; Use with: guix shell -m manifest.scm+3
;;+4
;; sigil-log is pure Scheme with no vendored C, so the environment+5
;; only needs the common Sigil build toolchain.+6
+7
(specifications->manifest+8
'("gcc-toolchain"+9
"make"+10
"pkg-config"))package.sglmodified
@@ -5,11 +5,12 @@
5
6
(package 7
name: "sigil-log"+8
version: "0.13.0" 9
description: "Structured logging for Sigil"−9
url: "https://codeberg.org/sigil/sigil"+10
url: "https://codeberg.org/sigil/sigil-log" 11
license: "BSD-3-Clause" 12
authors: (list "David Wilson <david@daviwil.com>") 13
14
dependencies: (list−14
(from-workspace name: "sigil-stdlib")−15
(from-workspace name: "sigil-json")))+15
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.0")+16
(from-git url: "codeberg:sigil/sigil" package: "sigil-json" version: "^0.13.0")))sigil.lockadded
@@ -0,0 +1,13 @@
+1
;; Auto-generated by sigil deps install. Do not edit.+2
(lock+3
(package name: "sigil-stdlib"+4
url: "codeberg:sigil/sigil"+5
ref: "^0.13.0"+6
sha: "8738c6f0665f6593795daf98d63839d181b17a4f"+7
package-selector: "sigil-stdlib")+8
(package name: "sigil-json"+9
url: "codeberg:sigil/sigil"+10
ref: "^0.13.0"+11
sha: "8738c6f0665f6593795daf98d63839d181b17a4f"+12
package-selector: "sigil-json")+13
)