logs

package
v2.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "2006-01-02T15:04:05.000Z07:00"

Variables

View Source
var D = _logger.Debug
View Source
var New = slog.New

Functions

func NewAttrReplacer

func NewAttrReplacer(color, short bool) func(groups []string, attr slog.Attr) slog.Attr

func NewColorableStdoutHandler

func NewColorableStdoutHandler(level level.Leveler) slog.Handler

func NewConsoleWriterHandler

func NewConsoleWriterHandler(writer io.Writer, source bool, level level.Leveler, color bool) slog.Handler

func NewJSONHandler

func NewJSONHandler(writer io.Writer, source bool, level level.Leveler) slog.Handler

func SetDefault

func SetDefault(logger *slog.Logger) *slog.Logger

Types

type MultiHandler

type MultiHandler struct {
	// contains filtered or unexported fields
}

func NewMultiHandler

func NewMultiHandler(handlers ...slog.Handler) *MultiHandler

func (*MultiHandler) Enabled

func (h *MultiHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*MultiHandler) Handle

func (h *MultiHandler) Handle(ctx context.Context, record slog.Record) error

func (*MultiHandler) WithAttrs

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

func (*MultiHandler) WithGroup

func (h *MultiHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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