• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

coder / slog / a4f439e455e1db7c96c91b1c24bd5ca561e2df89
96%

Build:
DEFAULT BRANCH: main
Ran 18 Sep 2026 10:43PM UTC
Jobs 1
Files 12
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Sep 2026 10:42PM UTC coverage: 96.08% (+0.05%) from 96.034%
a4f439e455e1db7c96c91b1c24bd5ca561e2df89

push

github

web-flow
feat: add FlightRecorder sink for deferred low-level logging (#237)

* feat: add Buffer sink for deferred low-level logging

Buffer is a Sink that holds entries below a configured level in a
fixed-size in-memory ring, forwarding entries at or above the level
immediately. Flush replays the buffered entries to the wrapped sinks.

This lets a program run its logger at LevelDebug to capture verbose
entries while only emitting them on demand (e.g. on an error or
connection failure), with a configurable buffer size. When full, the
oldest entry is evicted.

* feat: add Flusher interface for deferred sinks

Flusher (Flush(ctx)) lets callers trigger a flush without depending on
the concrete Buffer type, which is handy when the buffer is created in
one place and flushed in another. Buffer implements it.

* refactor: rename buffer.go and buffer_test.go to flightrecorder.go and
flightrecorder_test.go

* refactor: rename Buffer to FlightRecorder

* refactor: make flight recording a Logger flag with auto-flush on error

Rework the flight recorder from a standalone Buffer/Flusher sink into a
Logger capability. Logger.FlightRecorder(size) enables a rolling
in-memory history of below-level entries; the history is flushed to the
sinks automatically when an entry at LevelError or above is logged, or
manually via Logger.Flush.

Enabling flight recording is independent of the Logger level, so it is
order-independent with Leveled(). Derived loggers (With, Named, Leveled)
share the underlying ring and capture their derived fields and names.

Replace the fill-tracking branch in the ring with a monotonic written
counter: the ring is allocated at full length and writes always land at
written%size, so the write path is branchless and drain derives the
entry count and oldest position from written.

* refactor: track ring position and length instead of unbounded counter

Replace the monotonic written counter with bounded pos and length fields,
so neither grows without limit and t... (continued)

61 of 63 new or added lines in 2 files covered. (96.83%)

956 of 995 relevant lines covered (96.08%)

99.66 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
96.08
flightrecorder.go
Jobs
ID Job ID Ran Files Coverage
1 a4f439e455e1db7c96c91b1c24bd5ca561e2df89.1 18 Sep 2026 10:43PM UTC 12
96.08
GitHub Action Run
Source Files on build a4f439e455e1db7c96c91b1c24bd5ca561e2df89
  • Tree
  • List 12
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • a4f439e4 on github
  • Prev Build on main (#244048FB...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc