logger

package
v0.0.0-...-f261bde Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogEntrySetAttrs

func LogEntrySetAttrs(ctx context.Context, attrs ...slog.Attr)

func LogEntrySetError

func LogEntrySetError(ctx context.Context, err error)

func NewRouterLogger

func NewRouterLogger(log *slog.Logger) func(next http.Handler) http.Handler

func NewSLogger

func NewSLogger(cfg Config) *slog.Logger

Types

type Config

type Config struct {
	Output io.Writer
	Level  slog.Level `mapstructure:"level"`
}

type FxLogger

type FxLogger struct {
	Logger *slog.Logger
}

FxLogger is an Fx event logger that logs events to slog.

func NewFxLogger

func NewFxLogger(logger *slog.Logger) *FxLogger

func (*FxLogger) LogEvent

func (l *FxLogger) LogEvent(event fxevent.Event)

LogEvent logs the given event to the provided Zap logger.

Jump to

Keyboard shortcuts

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