~/talk

Structured Logging for the Standard Library

Talkat GopherCon 2023 · 2023-09-26..09-29· [go, developer-experience]
slides:none on file

Go 1.21 adds slog, a structured-logging API with two built-in handlers (text Handler and json Handler), integer levels with info at zero and a dynamic LevelVar, and a fast path called log.Add with Adder/slog.Value to avoid allocations. Groups and a LogValue method prevent key/type conflicts. Performance targets match Zap: benchmarks use parallel runs with roughly five attributes (common case), a fixed-size array to avoid allocations, and sync.Pool byte buffers; Handler has Enabled and preformat hooks for early rejection and caching.

AI-written summary · about

  1. 0:00Introduction
  2. 0:30Why Structured Logging
  3. 2:22Slug
  4. 7:46Speed
  5. 14:30Process
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.