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:
- Drop-in handler via slog.SetDefault
- Custom gologger levels usable from slog.Log(ctx, ...)
- All slog attribute kinds
- WithGroup flattening and WithAttrs persistence
- Mixing slog.* and gologger.* in the same program
- TrimGologgerLevels for clean level names in JSON/Text handlers
Click to show internal directories.
Click to hide internal directories.