log

package
v0.0.0-...-dfdee5b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, args ...interface{})

Debugf logs a message at level Debug on the standard logger.

func Debugln

func Debugln(args ...interface{})

Debugln logs a message at level Debug on the standard logger.

func Errorf

func Errorf(format string, args ...interface{})

Errorf logs a message at level Error on the standard logger.

func Errorln

func Errorln(args ...interface{})

Errorln logs a message at level Error on the standard logger.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs a message at level Fatal on the standard logger.

func Fatalln

func Fatalln(args ...interface{})

Fatalln logs a message at level Fatal on the standard logger.

func Infof

func Infof(format string, args ...interface{})

Infof logs a message at level Info on the standard logger.

func Infoln

func Infoln(args ...interface{})

Infoln logs a message at level Info on the standard logger.

func Panicf

func Panicf(format string, args ...interface{})

Panicf logs a message at level Fatal on the standard logger.

func Panicln

func Panicln(args ...interface{})

Panicln logs a message at level Fatal on the standard logger.

func SetLevel

func SetLevel(level Level)

SetLevel sets the Level of the base logger

func SetOut

func SetOut(out io.Writer)

SetOut sets the output destination base logger

func Tracef

func Tracef(format string, args ...interface{})

Tracef logs a message at level Debug on the standard logger.

func Traceln

func Traceln(args ...interface{})

Traceln logs a message at level Debug on the standard logger.

func Warnf

func Warnf(format string, args ...interface{})

Warnf logs a message at level Warn on the standard logger.

func Warnln

func Warnln(args ...interface{})

Warnln logs a message at level Warn on the standard logger.

Types

type Level

type Level uint8

Level describes the log severity level.

const (
	// PanicLevel level
	PanicLevel Level = iota
	// FatalLevel level
	FatalLevel
	// ErrorLevel level
	ErrorLevel
	// WarnLevel level
	WarnLevel
	// InfoLevel level
	InfoLevel
	// DebugLevel level
	DebugLevel
	// TraceLevel level
	TraceLevel
)

type Logger

type Logger interface {
	SetLevel(level Level)
	SetOut(out io.Writer)

	Traceln(...interface{})
	Tracef(string, ...interface{})

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

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

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

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

	Fatalln(...interface{})
	Fatalf(string, ...interface{})

	Panicln(v ...interface{})
	Panicf(format string, v ...interface{})
}

Logger is an interface that describes logging.

func Base

func Base() Logger

Base returns the base logger.

func New

func New() Logger

New returns a new logger.

func WithError

func WithError(err error) Logger

WithError returns a Logger that will print an error along with the next message.

func Withf

func Withf(key string, value interface{}) Logger

Withf attaches a key,value pair to a logger.

Jump to

Keyboard shortcuts

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