logger

package
v0.0.0-...-4d778f5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: MIT 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 is a logger level.

const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarning
	LevelError
	LevelPanic
)

Supported logger levels.

func ParseLevel

func ParseLevel(l string) Level

ParseLevel parses level from string.

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is a multiple level logger.

func New

func New(l Level) *Logger

New is a logger constructor.

func (*Logger) Debug

func (l *Logger) Debug(format string, v ...interface{})

Debug prints debug level log.

func (*Logger) Error

func (l *Logger) Error(format string, v ...interface{})

Error prints error level log.

func (*Logger) Info

func (l *Logger) Info(format string, v ...interface{})

Info prints info level log.

func (*Logger) Panic

func (l *Logger) Panic(format string, v ...interface{})

Panic prints panic level log and panics.

func (*Logger) Prefix

func (l *Logger) Prefix(p string, v ...interface{}) *Logger

Prefix adds prefix to every log message and returns a copy of the logger.

func (*Logger) Warning

func (l *Logger) Warning(format string, v ...interface{})

Warning prints info warning log.

Jump to

Keyboard shortcuts

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