lhelper

package
v0.0.0-...-532ff07 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const LevelTrace = slog.Level(-10)

Variables

This section is empty.

Functions

func DeriveLogger

func DeriveLogger(ctx context.Context, attrs ...any) *slog.Logger

func EnableGlobalLoggerFallback

func EnableGlobalLoggerFallback(enabled bool)

func IsGlobalLoggerFallbackEnabled

func IsGlobalLoggerFallbackEnabled() bool

func L

func L(ctx context.Context) *slog.Logger

func LTRACE

func LTRACE(ctx context.Context, msg string, args ...any)

LTRACE helper logs a trace message. It's a shorthand for L(ctx).Log(LevelTrace, msg, args...). It's not a wrapper function, but a reimplementation of slog.Logger.log to make sure it gets the correct PC location for the caller.

func TryGetLoggerFromContext

func TryGetLoggerFromContext(ctx context.Context) *slog.Logger

func WithLogger

func WithLogger(ctx context.Context, logger *slog.Logger) context.Context

Types

This section is empty.

Jump to

Keyboard shortcuts

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