Documentation
¶
Index ¶
- Constants
- func CreateAttributes(m map[string]string, attrs ...slog.Attr) []any
- func InitAsDefault(cfgLogger commoncfg.Logger, app commoncfg.Application) error
- func InitAsDefaultWithWriter(w io.Writer, cfgLogger commoncfg.Logger, app commoncfg.Application) error
- func InitHandler(cfgLogger commoncfg.Logger, app commoncfg.Application) (slog.Handler, error)
- func InitHandlerWithWriter(w io.Writer, cfgLogger commoncfg.Logger, app commoncfg.Application) (slog.Handler, error)
- type Middleware
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 ¶
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 ¶
InitHandler initializes the default handler
Types ¶
type Middleware ¶
func NewGDPRMiddleware ¶
func NewGDPRMiddleware(logger *commoncfg.Logger) Middleware
NewGDPRMiddleware creates a new gdprMiddleware with masking and renaming rules.
Click to show internal directories.
Click to hide internal directories.