log

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: GPL-3.0 Imports: 10 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 writes a 'debug' message to configured logger.

func Error

func Error(err error)

Error writes an error value to configured logger.

func Errorf

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

Errorf writes an 'error' message to configured logger.

func Fatal added in v0.3.4

func Fatal(err error)

Fatal writes an error value to configured logger. Application should terminate after logging.

func Fatalf

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

Fatalf writes a 'fatal' message to configured logger. Application should terminate after logging.

func Infof

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

Infof writes a 'info' message to configured logger.

func Set added in v0.3.4

func Set(logger Logger)

func Unset added in v0.3.4

func Unset()

func Warnf

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

Warnf writes a 'warning' message to configured logger.

Types

type Level added in v0.3.4

type Level int

Level represents log level type.

const (
	// DebugLevel represents DEBUG log level.
	DebugLevel Level = iota

	// InfoLevel represents INFO log level.
	InfoLevel

	// WarningLevel represents WARNING log level.
	WarningLevel

	// ErrorLevel represents ERROR log level.
	ErrorLevel

	// FatalLevel represents FATAL log level.
	FatalLevel

	// OffLevel represents a disabledLogger log level.
	OffLevel
)

type Logger

type Logger interface {
	io.Closer

	Level() Level
	Log(level Level, pkg string, file string, line int, format string, args ...interface{})
}
var Disabled Logger = &disabledLogger{}

func New added in v0.3.4

func New(level string, output io.Writer, files ...io.WriteCloser) (Logger, error)

Jump to

Keyboard shortcuts

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