logging

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error added in v0.0.9

func Error(err error) slog.Attr

func NewLogger added in v0.0.9

func NewLogger(logPath string, fileLevel, stdoutLevel slog.Level) *slog.Logger

func NewNullLogger added in v0.0.11

func NewNullLogger() *slog.Logger

Types

type NullHandler added in v0.0.11

type NullHandler utils.Unit

func (NullHandler) Enabled added in v0.0.11

func (h NullHandler) Enabled(_ context.Context, _ slog.Level) bool

func (NullHandler) Handle added in v0.0.11

func (h NullHandler) Handle(_ context.Context, _ slog.Record) error

func (NullHandler) WithAttrs added in v0.0.11

func (h NullHandler) WithAttrs(_ []slog.Attr) slog.Handler

func (NullHandler) WithGroup added in v0.0.11

func (h NullHandler) WithGroup(_ string) slog.Handler

type TeeHandler added in v0.0.9

type TeeHandler struct {
	Handlers []slog.Handler
}

func NewTeeHandler added in v0.0.9

func NewTeeHandler(handlers ...slog.Handler) *TeeHandler

func (*TeeHandler) Enabled added in v0.0.9

func (h *TeeHandler) Enabled(ctx context.Context, lvl slog.Level) bool

func (*TeeHandler) Handle added in v0.0.9

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

func (*TeeHandler) WithAttrs added in v0.0.9

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

func (*TeeHandler) WithGroup added in v0.0.9

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

Jump to

Keyboard shortcuts

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