log

package
v0.0.0-...-7ddf690 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseLevel

func ParseLevel(level string) (slog.Level, bool)

Types

type Logger

type Logger interface {
	Log(ctx context.Context, level slog.Level, msg string, args ...any)
	Info(msg string, args ...any)
	Debug(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
	With(args ...any) Logger
}

Logger defines the interface for structured logging.

func NewLogger

func NewLogger(opts ...LoggerOption) Logger

NewLogger creates a new Logger instance with the specified options.

type LoggerOption

type LoggerOption func(opts *loggerOptions)

LoggerOption configures a Logger.

func WithDevelopment

func WithDevelopment() LoggerOption

WithDevelopment configures the Logger for development mode with human-readable output.

func WithLevel

func WithLevel(level slog.Level) LoggerOption

WithLevel sets the logging level for the Logger.

func WithNop

func WithNop() LoggerOption

WithNop configures a no-operation Logger that discards all log messages.

Jump to

Keyboard shortcuts

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