logging

package
v0.0.0-...-8c7fdf7 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMuteLogger

func NewMuteLogger() *slog.Logger

func SetupAppLogger

func SetupAppLogger(writer *os.File, logLevel slog.Leveler, verbose bool) slog.Handler

func StrToLogLevel

func StrToLogLevel(logLevel string) (slog.Leveler, error)

Types

type InvalidLevelError

type InvalidLevelError struct {
	Message string
}

func (*InvalidLevelError) Error

func (e *InvalidLevelError) Error() string

type UserHandler

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

func NewUserHandler

func NewUserHandler(opts *slog.HandlerOptions) *UserHandler

func (*UserHandler) Enabled

func (h *UserHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*UserHandler) Handle

func (h *UserHandler) Handle(ctx context.Context, r slog.Record) error

func (*UserHandler) WithAttrs

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

func (*UserHandler) WithGroup

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

Jump to

Keyboard shortcuts

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