← Selected work
04 / Logging library

Firefly

Firefly is a C++20 logging library built to illuminate what is happening inside engine and application code without tying either one to a specific output format or logging implementation.

Technology
C++20 / Infrastructure
Status
In use
The challenge

Frame-by-frame visibility quickly becomes noise.

A useful engine logger has to serve humans during development and structured tooling after the fact. It also needs to handle repeated frame-by-frame messages without flooding its output, and preserve recent context when a process fails.

The approach

Treat each log as structured evidence.

A small logger interface accepts entries and delegates formatting to replaceable sinks. Named channels separate engine and game output, configurable deduplication controls repetition, and a ring-buffer crash sink preserves the events leading up to a failure.

Inside the project

What it does.

  1. 01

    Trace through fatal severity levels

  2. 02

    Named loggers and a concise macro API

  3. 03

    Plain text, CSV, JSON, and NDJSON sinks

  4. 04

    Configurable message deduplication windows

  5. 05

    A last-N crash-dump ring buffer

Design principles

How decisions
get made.

Separate data from format

Log entries are value snapshots; sinks decide how they are represented.

Integrate through adapters

Umbra consumes Firefly behind its own logger interface.

Keep the signal visible

Deduplication and named channels prevent useful events from disappearing into noise.

See the work

Firefly

View on GitHub
Next projectAmanuensis