logger

package
v0.0.0-...-cdb2ca0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level uint

Level expresses a logging level

const (
	DebugLevel Level = iota
	InfoLevel
	WarnLevel
	ErrorLevel
)

Available log levels

func ParseLevel

func ParseLevel(levelStr string) (Level, error)

ParseLevel turns the designated string into a log level or returns an error.

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	SetLevel(Level)

	Debug(...interface{})
	Debugf(string, ...interface{})
	Debugln(...interface{})

	Info(...interface{})
	Infof(string, ...interface{})
	Infoln(...interface{})

	Warn(...interface{})
	Warnf(string, ...interface{})
	Warnln(...interface{})

	Error(...interface{})
	Errorf(string, ...interface{})
	Errorln(...interface{})

	GetLogger(Level) *log.Logger
}

Logger offers various methods for logging information to the console

func New

func New(l Level) Logger

New returns a Logger at the designated Level.

Jump to

Keyboard shortcuts

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