log

package
v2.4.9 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// LevelDebug used for debug messages.
	LevelDebug
	// LevelInfo used for info messages.
	LevelInfo
	// LevelWarning used for warning messages.
	LevelWarning
	// LevelError used for error messages.
	LevelError
	// LevelFatal used for fatal messages. os.Exit(1) is called after printing.
	LevelFatal
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level uint

Level is the message urgency level.

type Logrus

type Logrus struct{}

Logrus is the default logger, using sirupsen/logrus as a backend.

func (Logrus) Log

func (s Logrus) Log(l Level, i ...interface{})

Log implements Dumper.

func (Logrus) Logf

func (s Logrus) Logf(l Level, msg string, args ...interface{})

Logf implements Dumper.

type Writer

type Writer interface {
	Log(Level, ...interface{})
	Logf(Level, string, ...interface{})
}

Writer accepts messages along with the Level.

var Default Writer

Default is the default logger.

type WriterC

type WriterC interface {
	Logc(context.Context, Level, ...interface{})
	Logcf(context.Context, Level, string, ...interface{})
}

WriterC is the context-aware Writer.

Jump to

Keyboard shortcuts

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