Documentation
¶
Overview ¶
Package zaplg adapts Uber's zap logging library for use with the lg interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var TestingFactoryFn = func(w io.Writer) lg.Log { return NewWith(w, "text", true, true, false, 0) }
TestingFactoryFn can be passed to testlg.NewWith to use zap as the backing impl.
Functions ¶
This section is empty.
Types ¶
type Log ¶
type Log struct {
*zap.SugaredLogger
}
Log implements lg.Log.
func New ¶
func New() *Log
New returns a Log that writes to os.Stdout in text format, reporting the timestamp, level, and caller.
func NewWith ¶
NewWith returns a Log that writes to w. Format should be one of "json" or "text"; defaults to "text". The timestamp, level and caller params determine if those fields are reported. The addCallerSkip param is used to to adjust the frame reported as the caller.
Use NewWithZap if more control over output options is desired.
func NewWithZap ¶
NewWithZap returns a Log backed by zlogger.