types

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 3 Imported by: 27

Documentation

Index

Constants

View Source
const (
	TimestampKey = "time"
	ErrorKey     = "error"
	SourceKey    = "source"
)

Variables

View Source
var (
	ErrInvalidLogLevel = errors.New("invalid log level")
)

Functions

This section is empty.

Types

type Context added in v0.2.5

type Context interface {
	Logger() Logger
	// contains filtered or unexported methods
}

type Event

type Event interface {
	Msg(msg string)
	Msgf(format string, args ...interface{})
	// contains filtered or unexported methods
}

type Level

type Level int
const (
	FatalLevel Level = iota
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
	TraceLevel
)

func (*Level) Set added in v0.3.1

func (l *Level) Set(v string) error

func (Level) String added in v0.3.1

func (l Level) String() string

func (Level) Type added in v0.3.1

func (l Level) Type() string

type Logger

type Logger interface {
	Level() Level
	SubLogger(source string) Logger
	With() Context

	Fatal() Event
	Error() Event
	Warn() Event
	Info() Event
	Debug() Event
	Trace() Event
}

type RootLogger added in v0.3.0

type RootLogger interface {
	SetLevel(level Level)
	Logger
}

Jump to

Keyboard shortcuts

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