log

package
v0.10.2-0...-4baa321 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 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

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

func Set(logger Logger)

Set sets the global logger.

func Unset

func Unset()

Unset disables a previously set global logger.

func Warnf

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

Warnf writes a 'warning' message to configured logger.

Types

type Level

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{})
}

Logger represents a common logger interface.

var Disabled Logger = &disabledLogger{}

Disabled stores a disabled logger instance.

func New

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

New returns a default logger instance.

Jump to

Keyboard shortcuts

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