golang-samber-slog

golang samber slog

samber ↓ 33k
Claude Code
View source ↗

What it does

  • github.com/samber/slog-multi — handler composition
  • github.com/samber/slog-sampling — throughput control
  • github.com/samber/slog-formatter — attribute transformation
  • Fanout latency = sum of all handler latencies (sequential). With 5 handlers at 10ms each, every log call costs 50ms. Use Pool() to reduce to max(latencies)
  • Pipe middleware adds per-record function call overhead — keep chains short (2-4 middlewares)
  • Benchmark your pipeline with go test -bench before production deployment
  • → See samber/cc-skills-golang@golang-observability skill for slog fundamentals (levels, context, handler setup, migration)

Requirements & configuration

  • Six composition patterns, each for a different routing need:
  • 5. Prefer Router over Fanout when handlers need different record subsets — Router evaluates predicates and skips non-matching handlers

Derived from the skill's own SKILL.md documentation · extracted 2026-07-23

golang samber slog

Source

Repository: https://github.com/samber/cc-skills-golang

golang-samber-slog FAQ

What does the golang-samber-slog skill do?

Structured logging extensions for Golang using samber/slog-**** packages — multi-handler pipelines (slog-multi), log sampling (slog-sampling), attribute formatting (slog-formatter), HTTP middleware (slog-fiber, slog-gin, slog-chi, slog-echo), and backend routing (slog-datadog, slog-sentry, slog-loki, slog-syslog, slog-logstash, slog-graylog...). Apply when using or adopting slog, or when the codebase already imports any github.com/samber/slog-* package. github.com/samber/slog-multi — handler composition github.com/samber/slog-sampling — throughput control

What does golang-samber-slog require?

Six composition patterns, each for a different routing need: 5. Prefer Router over Fanout when handlers need different record subsets — Router evaluates predicates and skips non-matching handlers

How do I install golang-samber-slog?

Run: npx -y skills add https://github.com/samber/cc-skills-golang --skill golang-samber-slog --agent claude-code — the source lives at github.com/samber/cc-skills-golang.

Maintain golang-samber-slog?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

golang-samber-slog on getagentictools
[![golang-samber-slog on getagentictools](https://getagentictools.com/badge/skills/samber-cc-skills-golang-golang-samber-slog.svg)](https://getagentictools.com/skills/samber-cc-skills-golang-golang-samber-slog?ref=badge)
npx agentictools info skills/samber-cc-skills-golang-golang-samber-slog

The second line is the CLI lookup for this page — handy in READMEs and docs.