humanslogger

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

README

humanslogger

Go Reference

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Handler

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

func NewHandler

func NewHandler(opts ...HandlerOption) *Handler

func (*Handler) Enabled

func (h *Handler) Enabled(context.Context, slog.Level) bool

func (*Handler) FormatColor

func (h *Handler) FormatColor(level slog.Level) string

func (*Handler) Handle

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

func (*Handler) WithAttrs

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

func (*Handler) WithGroup

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

type HandlerOption

type HandlerOption func(*Handler)

func WithLevel

func WithLevel(l slog.Level) HandlerOption

func WithWriter

func WithWriter(in io.Writer) HandlerOption

Jump to

Keyboard shortcuts

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