slog

command
v1.1.77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Example: using gologger as a log/slog handler.

gologger.DefaultLogger implements slog.Handler, so you can route the standard library's structured logger through gologger's CLI output without giving up the gologger.* fluent API. This example walks through the main slog integration points:

  1. Drop-in handler via slog.SetDefault
  2. Custom gologger levels usable from slog.Log(ctx, ...)
  3. All slog attribute kinds
  4. WithGroup flattening and WithAttrs persistence
  5. Mixing slog.* and gologger.* in the same program
  6. TrimGologgerLevels for clean level names in JSON/Text handlers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL