logger

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure added in v0.0.2

func Configure(level slog.Leveler, AddSource bool)

Configure() we only configure the default slog logger if you want a specific slog logger, just new one using package `log/slog`, instead this package

func ReplaceAttr added in v0.0.2

func ReplaceAttr(_ []string, attr slog.Attr) slog.Attr

ReplaceAttr using for slog.Options.Replace

func SetLogLevel

func SetLogLevel(level slog.Level)

Types

type PrettyHandler added in v0.0.2

type PrettyHandler struct {
	slog.Handler
	// contains filtered or unexported fields
}

func NewPrettyHandler added in v0.0.2

func NewPrettyHandler(out io.Writer, opts PrettyHandlerOptions) *PrettyHandler

func (*PrettyHandler) Handle added in v0.0.2

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

type PrettyHandlerOptions added in v0.0.2

type PrettyHandlerOptions struct {
	SlogOpts slog.HandlerOptions
}

type StackFrame added in v0.0.2

type StackFrame struct {
	Func   string `json:"func"`
	Source string `json:"source"`
	Line   string `json:"line"`
}

Jump to

Keyboard shortcuts

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