package log

Import Path
	github.com/pancsta/d2/lib/log (on go.dev)

Dependency Relation
	imports 7 packages, and imported by 2 packages

Involved Source Files Copied from https://pkg.go.dev/log/slog#Handler Package log is a context wrapper around slog.Logger prettyhandler.go
Package-Level Type Names (total 2)
/* sort by: | */
A LevelHandler wraps a Handler with an Enabled method that returns false for levels below a minimum. Enabled implements Handler.Enabled by reporting whether level is at least as large as h's level. Handle implements Handler.Handle. Handler returns the Handler wrapped by h. WithAttrs implements Handler.WithAttrs. WithGroup implements Handler.WithGroup. *LevelHandler : log/slog.Handler func NewLevelHandler(level slog.Leveler, h slog.Handler) *LevelHandler
(*PrettyHandler) Enabled(ctx context.Context, level slog.Level) bool (*PrettyHandler) Handle(ctx context.Context, r slog.Record) error (*PrettyHandler) WithAttrs(attrs []slog.Attr) slog.Handler (*PrettyHandler) WithGroup(name string) slog.Handler *PrettyHandler : log/slog.Handler func NewPrettyHandler(h slog.Handler) *PrettyHandler
Package-Level Functions (total 11)
func Debug(ctx context.Context, msg string, attrs ...slog.Attr)
func Error(ctx context.Context, msg string, attrs ...slog.Attr)
func Info(ctx context.Context, msg string, attrs ...slog.Attr)
func Init()
NewLevelHandler returns a LevelHandler with the given level. All methods except Enabled delegate to h.
func Warn(ctx context.Context, msg string, attrs ...slog.Attr)
WithTB returns a context whose logger writes to tb. Deprecated: WithTB is a test-only convenience helper and will be removed after one compatibility release. Downstream tests should create an slog logger backed by their test logger and pass it to With.