log

package
v0.11.0-dev.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLevel added in v0.4.8

func IsLevel(logger Logger, level Level) bool

IsLevel reports whether current logger shows logs for the given log level.

Types

type ErrorWithFields

type ErrorWithFields interface {
	error
	Fields() Fields
}

type Fields

type Fields = map[string]interface{}

type Level

type Level uint8
const (
	Panic Level = iota
	Error
	Warn
	Info
	Debug
)

func ParseLevel

func ParseLevel(lvl string) (Level, error)

ParseLevel takes a string level and returns the Logrus log level constant.

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	Level() Level

	WithField(key string, value interface{}) Logger
	WithFields(fields Fields) Logger
	WithError(err error) Logger

	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Panicf(format string, args ...interface{})

	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Panic(args ...interface{})
}

type LoggerService added in v0.6.0

type LoggerService interface {
	Logger
	Start(ctx context.Context) error
	Wait() <-chan error
}

LoggerService is a logger that needs to be started to be used.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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