log

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 9 Imported by: 0

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
}

Logger wraps a slog.Logger to provide a streamlined API and consistent behavior for the Perseus application.

func New

func New(level slog.Leveler) *Logger

New initializes and returns a new Logger using [level] to dynamically determine the active verbosity level.

func (*Logger) Debug

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

Debug logs a message at DEBUG level with the specified message and attributes.

func (*Logger) Error

func (l *Logger) Error(err error, msg string, kvs ...any)

Error logs a message at ERROR level with the specified message and attributes. If [err] is not nil, it will be logged in an additional attribute called "err".

func (*Logger) Info

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

Info logs a message at INFO level with the specified message and attributes.

Jump to

Keyboard shortcuts

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