logging

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForScope added in v0.0.2

func ForScope(conf config.Config, scope string) *slog.Logger

ForScope creates a logger for the given package scope, according to user config. Falls back to conf.LogLevel (see config.Config#LogLevelFor).

func New

func New(level slog.Leveler) *slog.Logger

New returns a new slog.Logger configured appropriately for the environment. It uses a TextHandler if stdout is a terminal, and a JSONHandler otherwise. All logging is directed to os.Stdout to keep stdout clean for MCP stdio transport.

func NewWithWriter added in v0.0.8

func NewWithWriter(level slog.Leveler, writer *os.File) *slog.Logger

NewWithWriter is like New but allows specifying the output writer, which is useful for testing or stdio output.

func ParseLevel added in v0.0.2

func ParseLevel(s string) slog.Level

ParseLevel parses a level string (debug, info, warn, error) into a slog.Level. Default is slog.LevelWarn.

Types

This section is empty.

Jump to

Keyboard shortcuts

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