feat(log): the complete structured logging package #2
merged
@chrismichaelps wrote on 2026-09-28
Closes #1
Behaviour
- Message templates: named, numbered,
@destructured and$stringified holes, formats, alignment, escaped braces, and literal fallback for malformed holes. - Capture: depth, text-length, and collection-count limits; tag transforms, scalar tags, custom rules, and rules that leave out or mask members of a tag; binding diagnostics reported to the self-log.
- Pipeline: minimum levels, level switches, per-source overrides (matched against the source as given, before truncation), context loggers, trace and span identifiers, enrichers, filters, sub-loggers, restricted, conditional, fallible, fallback-chain, and audit sinks, and reloadable loggers.
- Formatting: output templates, number and date format specifiers, JSON, compact JSON, rendered compact JSON, and a reader that turns compact JSON back into events.
- Sinks: console with themes, rolling file with size limits, retention, buffering, and hooks, async, batching with retry backoff, HTTP, in-memory, keyed (one sink per key with least-recently-used closing), and observable.
- Enrichers for machine, user, environment, process id and name, environment variables, and failure details; masking of sensitive values by name and by pattern; an ambient context stack.
- The expression language: filters, computed properties, and expression templates with
#ifand#each. - Settings: configuration from key-value pairs, JSON sections, and environment variables through a registry of named sinks and enrichers, with level switches handed back.
- Web: request completion events and correlation identifiers; timed operations; a bridge from
Std.Log.
Verification
On the published Pudu 0.1.2 archive:
pudu check,pudu fmt --check, andpudu lintare clean oversrc,test,tools, andexamples.pudu test test: 37 suites, 632 assertions, includingtest/Package/VaultTest(the vault mirrorssrc/) andtest/Package/LayoutTest.- All six examples answer 0.
- Mutation testing over
Domain/: 456 of 456 mutants killed locally, and the four CI shards pass at a threshold of 100.
