logutil

package
v0.0.0-...-9200811 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: AGPL-3.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context map[string]interface{}

type Log

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

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

func WrapLogWithContext

func WrapLogWithContext(log Log, lctx Context) Log

type LogLevel

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 occurred.
	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

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

func NewStderrLog

func NewStderrLog(name string, debugKeys ...string) *StderrLog

func (StderrLog) Child

func (sl StderrLog) Child(name string) Log

func (StderrLog) Debugf

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

func (StderrLog) Errorf

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

func (StderrLog) Fatalf

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

func (StderrLog) Infof

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

func (*StderrLog) SetLevel

func (sl *StderrLog) SetLevel(level LogLevel)

func (StderrLog) Warnf

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