Skip to content

Prepare Chroma Logger 0.2.0-rc.1 for Zig 0.16 - #1

Merged
adia-dev merged 1 commit into
mainfrom
agent/zig-016-redesign
Aug 1, 2026
Merged

adia-dev merged 1 commit into
mainfrom
agent/zig-016-redesign

Conversation

@adia-dev

@adia-dev adia-dev commented Aug 1, 2026 •

Copy link
Copy Markdown
Owner

Release status

This PR targets v0.2.0-rc.1, an experimental release candidate. The current implementation is intended for CLI tools, development utilities, and modest logging volume—not high-throughput or latency-sensitive logging workloads.

The README now documents the synchronous stderr design, current performance limitations, and an experimental roadmap for providers, structured records, file output, buffering, and syslog. Those larger APIs are intentionally deferred so this release can gather feedback around a focused console logger.

What changed

  • migrated the package and build graph to Zig 0.16.0 and Chroma 0.2.0
  • replaced the duplicated logging functions with one configurable Logger(comptime config) type
  • added typed themes, labels, layout, scopes, timestamps, fixed UTC offsets, and automatic/forced/plain color policies
  • added compile-time Chroma message configuration, including semantic styles and custom grammar
  • added a deterministic writer API for tests, files, buffers, and application-owned sinks
  • made synchronous stderr output atomic and allocation-free through Zig's locked writer
  • added exact-output tests, configuration compile-error fixtures, a compile stress fixture, and multi-platform CI
  • added a consumer-style ZON example, rewritten documentation, migration guidance, and a real VHS live demo in GIF and MP4 formats

Why

The previous implementation had three mostly duplicated output paths, ignored scopes, always emitted ANSI, hard-coded a UTC+1 offset, swallowed every writer concern inside the only API, and had no automated tests. Its Chroma directives and Zig build APIs were also outdated.

The release candidate keeps formatting and configuration at comptime while making the runtime responsibilities explicit: read the clock, choose ANSI or plain output, substitute Zig arguments, acquire the stderr lock, and write the line.

Compatibility

This is a breaking v0.2 release candidate for Zig 0.16. Message directives are namespaced ({red} becomes {#red}), and timeBasedLog / defaultLog are replaced by Logger layout configuration. The default chroma_logger.log entry point remains available.

Validation

  • zig fmt --check .
  • zig build test
  • zig build benchmark -Doptimize=ReleaseFast
  • zig build -Doptimize=ReleaseFast
  • zig build -Dtarget=x86_64-linux
  • zig build -Dtarget=aarch64-linux
  • zig build -Dtarget=x86_64-windows
  • zig build -Dtarget=aarch64-macos
  • vhs validate docs/demo.tape
  • regenerated and inspected both RC video outputs

Live demo

Chroma Logger live demo

@adia-dev
adia-dev marked this pull request as ready for review August 1, 2026 21:52
@adia-dev
adia-dev merged commit 949f752 into main Aug 1, 2026
8 checks passed
@adia-dev adia-dev changed the title Redesign Chroma Logger for Zig 0.16 Prepare Chroma Logger 0.2.0-rc.1 for Zig 0.16 Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant