log: golint fixes

This commit is contained in:
Mike Kinney 2019-12-09 22:15:38 -08:00
parent 784cf0a407
commit 741d9a7aaf
4 changed files with 11 additions and 1 deletions

View file

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

View file

@ -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
}

View file

@ -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
)

View file

@ -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())
)