mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
log: golint fixes
This commit is contained in:
parent
784cf0a407
commit
741d9a7aaf
4 changed files with 11 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Package log15 provides an opinionated, simple toolkit for best-practice logging that is
|
||||
Package log provides an opinionated, simple toolkit for best-practice logging that is
|
||||
both human and machine readable. It is modeled after the standard library's io and net/http
|
||||
packages.
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ var fieldPadding = make(map[string]int)
|
|||
// fieldPaddingLock is a global mutex protecting the field padding map.
|
||||
var fieldPaddingLock sync.RWMutex
|
||||
|
||||
// Format is an interface for the formatting
|
||||
type Format interface {
|
||||
Format(r *Record) []byte
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,14 +15,21 @@ const ctxKey = "ctx"
|
|||
const errorKey = "LOG15_ERROR"
|
||||
const skipLevel = 2
|
||||
|
||||
// Lvl is a type for logging levels
|
||||
type Lvl int
|
||||
|
||||
const (
|
||||
// LvlCrit is the CRIT logging level
|
||||
LvlCrit Lvl = iota
|
||||
// LvlError is the ERROR logging level
|
||||
LvlError
|
||||
// LvlWarn is the WARN logging level
|
||||
LvlWarn
|
||||
// LvlInfo is the INFO logging level
|
||||
LvlInfo
|
||||
// LvlDebug is the DEBUG logging level
|
||||
LvlDebug
|
||||
// LvlTrace is the TRACE logging level
|
||||
LvlTrace
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ import (
|
|||
|
||||
var (
|
||||
root = &logger{[]interface{}{}, new(swapHandler)}
|
||||
// StdoutHandler is the standard output handler
|
||||
StdoutHandler = StreamHandler(os.Stdout, LogfmtFormat())
|
||||
// StderrHandler is the standard error handler
|
||||
StderrHandler = StreamHandler(os.Stderr, LogfmtFormat())
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue