logger

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 10 Imported by: ? 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

This section is empty.

Types

type Logger

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

func Disabled

func Disabled() *Logger

Disabled returns a logger that discards everything.

func From

func From(sl *slog.Logger) *Logger

From wraps an existing *slog.Logger; a nil sl yields a disabled logger.

func New

func New(opts ...Option) *Logger

New builds a Logger from options. With no options it logs INFO+ to stderr.

func (*Logger) Debug

func (l *Logger) Debug(msg string, args ...any)

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...any)

func (*Logger) Error

func (l *Logger) Error(msg string, args ...any)

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...any)

func (*Logger) Info

func (l *Logger) Info(msg string, args ...any)

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...any)

func (*Logger) Warn

func (l *Logger) Warn(msg string, args ...any)

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...any)

func (*Logger) With

func (l *Logger) With(args ...any) *Logger

With returns a child logger that attaches the given attrs to every record.

type Option

type Option func(*config)

func WithHandler

func WithHandler(h slog.Handler) Option

WithHandler supplies a custom slog.Handler, overriding level/output.

func WithLevel

func WithLevel(l slog.Level) Option

func WithOutput

func WithOutput(w io.Writer) Option

Jump to

Keyboard shortcuts

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