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

coder / slog
96%

Build:
DEFAULT BRANCH: main
Repo Added 05 Jan 2022 12:31PM UTC
Token RwaFMiyeLjsSbbPvnzRlCGnFaUGTPofYK regen
Build 169 Last
Files 12
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

LAST BUILD ON BRANCH main
branch: SELECT
CHANGE BRANCH
x
Sync Branches
  • No branch selected
  • TERM-4389
  • add-log-buffer-sink
  • callum/human-perf
  • calm-sublogger
  • chore/dependency-security-updates
  • colin/fix-ci
  • colin/otel
  • colin/revert
  • colin/sync-test-logs
  • colin/update-all-deps
  • colin/x-term
  • dependabot/go_modules/cloud.google.com/go-0.100.1
  • dependabot/go_modules/cloud.google.com/go-0.100.2
  • dependabot/go_modules/cloud.google.com/go-0.107.0
  • dependabot/go_modules/cloud.google.com/go-0.108.0
  • dependabot/go_modules/cloud.google.com/go-0.109.0
  • dependabot/go_modules/cloud.google.com/go-0.110.2
  • dependabot/go_modules/cloud.google.com/go/compute-1.10.0
  • dependabot/go_modules/cloud.google.com/go/compute-1.11.0
  • dependabot/go_modules/cloud.google.com/go/compute-1.12.1
  • dependabot/go_modules/cloud.google.com/go/compute-1.13.0
  • dependabot/go_modules/cloud.google.com/go/compute-1.14.0
  • dependabot/go_modules/cloud.google.com/go/compute-1.6.1
  • dependabot/go_modules/cloud.google.com/go/compute-1.7.0
  • dependabot/go_modules/cloud.google.com/go/compute-1.8.0
  • dependabot/go_modules/cloud.google.com/go/compute-1.9.0
  • dependabot/go_modules/cloud.google.com/go/logging-1.19.0
  • dependabot/go_modules/cloud.google.com/go/logging-1.19.1
  • dependabot/go_modules/github.com/alecthomas/chroma-0.10.0
  • dependabot/go_modules/github.com/charmbracelet/lipgloss-0.9.1
  • dependabot/go_modules/github.com/fatih/color-1.14.0
  • dependabot/go_modules/github.com/fatih/color-1.14.1
  • dependabot/go_modules/github.com/google/go-cmp-0.5.7
  • dependabot/go_modules/github.com/google/go-cmp-0.5.8
  • dependabot/go_modules/github.com/google/go-cmp-0.5.9
  • dependabot/go_modules/github.com/google/go-cmp-0.6.0
  • dependabot/go_modules/github.com/muesli/termenv-0.15.2
  • dependabot/go_modules/go.opencensus.io-0.24.0
  • dependabot/go_modules/go.opentelemetry.io/otel/trace-1.19.0
  • dependabot/go_modules/golang.org/x/crypto-0.10.0
  • dependabot/go_modules/golang.org/x/crypto-0.11.0
  • dependabot/go_modules/golang.org/x/crypto-0.9.0
  • dependabot/go_modules/golang.org/x/net-0.17.0
  • dependabot/go_modules/golang.org/x/term-0.12.0
  • dependabot/go_modules/golang.org/x/term-0.13.0
  • dependabot/go_modules/golang.org/x/term-0.14.0
  • dependabot/go_modules/golang.org/x/term-0.44.0
  • dependabot/go_modules/golang.org/x/term-0.45.0
  • dependabot/go_modules/google.golang.org/grpc-1.57.1
  • dependabot/go_modules/google.golang.org/grpc-1.82.1
  • dependabot/go_modules/google.golang.org/grpc-1.83.1
  • dependabot/go_modules/otel-19afbd04db
  • dependabot/go_modules/otel-526f66d0b0
  • dependabot/go_modules/otel-87141668d4
  • dependabot/go_modules/otel-b6fd91a875
  • dependabot/go_modules/otel-be7620059b
  • dependabot/go_modules/otel-da2746b111
  • dk/err-formatting
  • ethan/handle-sql-types-slogjson
  • fix-stackdriver
  • fix/syncwriter-stderr-corruption
  • human
  • kvapi
  • mafredri-patch-1
  • mafredri/safer-istty
  • main
  • nuke-cf1b
  • refs/heads/main
  • refs/pull/184/merge
  • refs/pull/185/merge
  • refs/pull/186/merge
  • refs/pull/188/merge
  • refs/pull/189/merge
  • refs/pull/190/merge
  • refs/pull/194/merge
  • refs/pull/198/merge
  • spike/dont-panic
  • spike/ignore-context-canceled
  • spike/ignore-error-fn
  • spike/v3
  • terrastruct

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

Relevant lines Covered
Build:
Build:
995 RELEVANT LINES 956 COVERED LINES
99.66 HITS PER LINE
Source Files on main
  • Tree
  • List 12
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
a4f439e4... main 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 abov... push 18 Sep 2026 10:43PM UTC web-flow github
96.08
5573165b... add-log-buffer-sink Merge 72b7255f8 into 244048fb9 Pull #237 18 Sep 2026 10:21PM UTC web-flow github
96.08
198933e2... add-log-buffer-sink Merge 310f9fab1 into 244048fb9 Pull #237 17 Sep 2026 09:28PM UTC web-flow github
96.09
596366c8... add-log-buffer-sink Merge 792bc1b10 into 244048fb9 Pull #237 17 Sep 2026 07:16PM UTC web-flow github
96.04
9d465b7a... add-log-buffer-sink Merge 695581203 into 244048fb9 Pull #237 14 Sep 2026 09:17PM UTC web-flow github
96.04
8097d450... add-log-buffer-sink Merge de93e212e into 244048fb9 Pull #237 10 Sep 2026 10:59PM UTC web-flow github
96.04
8db1d452... dependabot/go_modules/google.golang.org/grpc-1.83.1 Merge 14357818b into 244048fb9 Pull #236 02 Sep 2026 07:25AM UTC web-flow github
96.03
5ca8eb9c... dependabot/go_modules/cloud.google.com/go/logging-1.19.1 Merge 91952eec1 into 244048fb9 Pull #235 11 Aug 2026 11:05AM UTC web-flow github
96.03
bc1f86e0... dependabot/go_modules/otel-da2746b111 Merge 81495d7c4 into 244048fb9 Pull #234 07 Aug 2026 11:05AM UTC web-flow github
96.03
af41645d... dependabot/go_modules/google.golang.org/grpc-1.82.1 Merge 4c34f5122 into 244048fb9 Pull #233 25 Jul 2026 03:10AM UTC web-flow github
96.03
See All Builds (169)

Badge your Repo: slog

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

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

Refresh
  • Settings
  • Repo on GitHub
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