Help us shape the future of Go! Take the 2026 Go Developer Survey

logging

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLevelFilter added in v0.4.0

func NewLevelFilter(minLevel slog.Level, inner slog.Handler) slog.Handler

NewLevelFilter wraps inner, silently dropping records below minLevel. Use this to give a specific handler (e.g. the OTEL log bridge) a different minimum level than the console handler.

func SetLevel added in v0.14.0

func SetLevel(level string) error

SetLevel changes the console log level of the logger installed by Setup.

func Setup

func Setup(level, format string, timestamps bool, extra ...slog.Handler) *slog.Logger

Setup creates a structured slog.Logger and installs it as the global default. Any additional slog.Handlers (e.g. an OTEL log bridge) can be appended via the extra variadic parameter. Log records are sent to all handlers. timestamps controls whether console records carry a time; disable it under journald, which records its own.

Types

This section is empty.

Jump to

Keyboard shortcuts

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