logger

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLog

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

func InjectLog

func InjectLog(log *slog.Logger) box.I

func SetLog

func SetLog(ctx context.Context, log *slog.Logger) context.Context

Types

type ColorsHandler

type ColorsHandler struct {
	slog.Handler
}

ColorsHandler envuelve el TextHandler y agrega colores según el nivel del log

func NewColorsHandler

func NewColorsHandler(h slog.Handler) *ColorsHandler

func (*ColorsHandler) Handle

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

func (*ColorsHandler) WithAttrs

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

Jump to

Keyboard shortcuts

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