logging

package
v0.19.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCLILogger

func NewCLILogger(level string) *slog.Logger

func ParseLogLevel

func ParseLogLevel(level string) slog.Level

ParseLogLevel converts a string log level to slog.Level. Defaults to slog.LevelInfo for unrecognized strings.

func SetDefaultCLILogger

func SetDefaultCLILogger(level string)

func SetDefaultJSONLogger added in v0.19.1

func SetDefaultJSONLogger(level string)

Types

type CLIHandler

type CLIHandler struct {
	// contains filtered or unexported fields
}

CLIHandler is a custom slog.Handler for CLI output.

func NewCLIHandler

func NewCLIHandler(w io.Writer, level slog.Level) *CLIHandler

func (*CLIHandler) Enabled

func (h *CLIHandler) Enabled(_ context.Context, level slog.Level) bool

func (*CLIHandler) Handle

func (h *CLIHandler) Handle(_ context.Context, r slog.Record) error

func (*CLIHandler) WithAttrs

func (h *CLIHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*CLIHandler) WithGroup

func (h *CLIHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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