logging

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 4 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

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