logging

package
v0.0.0-...-2ac9a84 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default() *slog.Logger

Default returns the default logger for backward compatibility

func DeleteGoroutineLogger

func DeleteGoroutineLogger(gid uint64)

func From

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

from returns the request scoped logger if present, else the global default

func GetBaseLogger

func GetBaseLogger() *slog.Logger

GetBaseLogger returns the base logger for use in middleware (avoids loops)

func GetGoroutineID

func GetGoroutineID() uint64

func InheritRequestLogger

func InheritRequestLogger(ctx context.Context) (cleanup func())

Add this helper function:

func Init

func Init() *slog.Logger

sets up the process wide base logger with automatic context detection

func Inject

func Inject(ctx context.Context, l *slog.Logger) context.Context

inject stores a logger in ctx

func Middleware

func Middleware() gin.HandlerFunc

func StoreGoroutineLogger

func StoreGoroutineLogger(gid uint64, logger *slog.Logger)

Helper functions for middleware to access the goroutine map

Types

This section is empty.

Jump to

Keyboard shortcuts

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