logUtils

package
v0.0.0-...-1db2ff1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DebugLevel - duh
	DebugLevel = log15.LvlDebug
	// InfoLevel - duh
	InfoLevel = log15.LvlInfo
	// WarnLevel - duh
	WarnLevel = log15.LvlWarn
	// ErrorLevel - duh
	ErrorLevel = log15.LvlError
	// CritLevel - duh
	CritLevel = log15.LvlCrit
)

Variables

This section is empty.

Functions

func SetLevel

func SetLevel(level log15.Lvl)

SetLevel sets the global log level for log15-based loggers

Types

type Logger

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

Logger is our extension of the log15 Logger type

func NewEnvLogger

func NewEnvLogger(lvlEnvVar string, args ...interface{}) Logger

NewEnvLogger gives a logger using the env var supplied for specifying the loglevel If the envVar contains bogus info, defaults to Info level The env var should be one of debug | info | warn | error | crit

func NewLogger

func NewLogger(args ...interface{}) Logger

NewLogger creates a new logger with the default handlers

func (Logger) ChildLogger

func (logger Logger) ChildLogger(ctx ...interface{}) Logger

ChildLogger is a method that lets us create child loggers of the same type

func (Logger) Error

func (logger Logger) Error(arg1 string, args ...interface{})

ErrorStackTrace logs a stack trace for the given error

func (Logger) Printf

func (logger Logger) Printf(arg1 string, args ...interface{})

Printf is implemented so that our logger conforms to the GorpLogger interface and can be used for logging queries in that require gorp.DbMap SOURCE: https://godoc.org/github.com/coopernurse/gorp#GorpLogger NOTE: https://github.com/go-gorp/gorp

Jump to

Keyboard shortcuts

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