logutils

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func HaveDebugTag added in v1.7.1

func HaveDebugTag(tag string) bool

func IsDebugEnabled added in v1.7.1

func IsDebugEnabled() bool

func SetupVerboseLog added in v1.7.1

func SetupVerboseLog(log Log, isVerbose bool)

Types

type DebugFunc added in v1.7.1

type DebugFunc func(format string, args ...interface{})

func Debug added in v1.7.1

func Debug(tag string) DebugFunc

type Log added in v1.7.1

type Log interface {
	Fatalf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Infof(format string, args ...interface{})

	Child(name string) Log
	SetLevel(level LogLevel)
}

type LogLevel added in v1.7.1

type LogLevel int
const (
	// debug message, write to debug logs only by logutils.Debug
	LogLevelDebug LogLevel = 0

	// information messages, don't write too much messages,
	// only useful ones: they are shown when running with -v
	LogLevelInfo LogLevel = 1

	// hidden errors: non critical errors: work can be continued, no need to fail whole program;
	// tests will crash if any warning occured.
	LogLevelWarn LogLevel = 2

	// only not hidden from user errors: whole program failing, usually
	// error logging happens in 1-2 places: in the "main" function.
	LogLevelError LogLevel = 3
)

type StderrLog added in v1.7.1

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

func NewStderrLog added in v1.7.1

func NewStderrLog(name string) *StderrLog

func (StderrLog) Child added in v1.7.1

func (sl StderrLog) Child(name string) Log

func (StderrLog) Debugf added in v1.7.1

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

func (StderrLog) Errorf added in v1.7.1

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

func (StderrLog) Fatalf added in v1.7.1

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

func (StderrLog) Infof added in v1.7.1

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

func (*StderrLog) SetLevel added in v1.7.1

func (sl *StderrLog) SetLevel(level LogLevel)

func (StderrLog) Warnf added in v1.7.1

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

Jump to

Keyboard shortcuts

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