Pudu programming language
Menu
Package

@chrismichaelps / pudu-lang-log

Structured event logging for Pudu: message templates, enrichment, filtering, formatting, and sinks

0.1.0Apache-2.01

InstallClose

← All contributions

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 #if and #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, and pudu lint are clean over src, test, tools, and examples.
  • pudu test test: 37 suites, 632 assertions, including test/Package/VaultTest (the vault mirrors src/) and test/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.

Read and reply on GitHub ↗