From 741d9a7aaf9929f9dda9c6f900ab3f576bc4c18a Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Mon, 9 Dec 2019 22:15:38 -0800 Subject: [PATCH] log: golint fixes --- log/doc.go | 2 +- log/format.go | 1 + log/logger.go | 7 +++++++ log/root.go | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/log/doc.go b/log/doc.go index bff2f4966a..2030f51020 100644 --- a/log/doc.go +++ b/log/doc.go @@ -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. diff --git a/log/format.go b/log/format.go index a1b5dac629..f30d41ccc9 100644 --- a/log/format.go +++ b/log/format.go @@ -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 } diff --git a/log/logger.go b/log/logger.go index 276d6969e2..d2e79cd78e 100644 --- a/log/logger.go +++ b/log/logger.go @@ -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 ) diff --git a/log/root.go b/log/root.go index 9fb4c5ae0b..4c7ca9422b 100644 --- a/log/root.go +++ b/log/root.go @@ -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()) )