level

package
v2.0.22 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Colors = map[Level]int{
	Debug: 0,
	Info:  colorGreen,
	Warn:  colorYellow,
	Error: colorRed,
	Fatal: colorRed,
}
View Source
var ShortStrings = map[Level]string{
	Debug: "DBG",
	Info:  "INF",
	Warn:  "WRN",
	Error: "ERR",
	Fatal: "FTL",
}
View Source
var Strings = map[Level]string{
	Debug: "DEBUG",
	Info:  "INFO",
	Warn:  "WARN",
	Error: "ERROR",
	Fatal: "FATAL",
}

Functions

func Colorize

func Colorize(s string, c int, color bool) string

Types

type Level

type Level int
const (
	Debug Level = -4
	Info  Level = 0
	Warn  Level = 4
	Error Level = 8
	Fatal Level = 16
)

func (Level) Color

func (l Level) Color() int

func (Level) ColorString

func (l Level) ColorString(color, short bool) string

func (Level) Level

func (l Level) Level() slog.Level

func (Level) MarshalJSON

func (l Level) MarshalJSON() ([]byte, error)

func (Level) MarshalText

func (l Level) MarshalText() (bs []byte, err error)

func (Level) ShortString

func (l Level) ShortString() string

func (Level) String

func (l Level) String() string

func (*Level) UnmarshalJSON

func (l *Level) UnmarshalJSON(bs []byte) error

func (*Level) UnmarshalText

func (l *Level) UnmarshalText(bs []byte) error

type Leveler

type Leveler = slog.Leveler

Jump to

Keyboard shortcuts

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