logger

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLevelActive

func IsLevelActive(current Level, wanted Level) bool

func WithLogger added in v0.3.0

func WithLogger(ctx context.Context, log Logger) context.Context

Types

type Level

type Level int
const (
	LvlDebug Level = iota
	LvlInfo
	LvlWarn
	LvlError
)

type Logger

type Logger interface {
	Debug(a ...any)
	Debugf(format string, a ...any)
	Info(a ...any)
	Infof(format string, a ...any)
	Warn(a ...any)
	Warnf(format string, a ...any)
	Error(a ...any)
	Errorf(format string, a ...any)
	Fatal(a ...any)
	Fatalf(format string, a ...any)
	Writer() io.Writer
	Level() Level
	SetLevel(lvl Level)
	SetPalette(palette Palette)
	SetColors(active bool)
}

func FromContext added in v0.3.0

func FromContext(ctx context.Context) Logger

func New

func New(lvl Level) Logger

type Palette

type Palette string
const (
	PaletteDefault Palette = "default"
)

Jump to

Keyboard shortcuts

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