logger

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const (
	TimeAttribute    = "time"
	LevelAttribute   = "level"
	MessageAttribute = "msg"
	// LevelTrace is a custom log level for trace logging with value -8
	LevelTrace = slog.Level(-8)
)

Variables

This section is empty.

Functions

func CreateAttributes

func CreateAttributes(m map[string]string, attrs ...slog.Attr) []any

CreateAttributes converts a map and additional slog attributes into a unified slice of attributes.

func InitAsDefault

func InitAsDefault(cfgLogger commoncfg.Logger, app commoncfg.Application) error

InitAsDefault sets default logger according to configuration

func InitAsDefaultWithWriter

func InitAsDefaultWithWriter(w io.Writer, cfgLogger commoncfg.Logger, app commoncfg.Application) error

InitAsDefaultWithWriter initializes the default logger using the provided writer, logger config, and application info.

func InitHandler

func InitHandler(cfgLogger commoncfg.Logger, app commoncfg.Application) (slog.Handler, error)

InitHandler initializes the default handler

func InitHandlerWithWriter

func InitHandlerWithWriter(w io.Writer, cfgLogger commoncfg.Logger, app commoncfg.Application) (slog.Handler, error)

InitHandlerWithWriter initializes the default Handler with provided writer, logger config and application info.

Types

type Middleware

type Middleware func(slog.Handler) slog.Handler

func NewGDPRMiddleware

func NewGDPRMiddleware(logger *commoncfg.Logger) Middleware

NewGDPRMiddleware creates a new gdprMiddleware with masking and renaming rules.

Jump to

Keyboard shortcuts

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