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, testingFormat, true, true, true, true, 1) }
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 // contains filtered or unexported fields }
Log wraps zap's logger, adding the WarnIf_ functions.
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 ¶
func NewWith(w io.Writer, format string, timestamp, utc, level, caller bool, addCallerSkip int) *Log
NewWith returns a Log that writes to w. Format should be one of "json", "text", or "testing"; defaults to "text". The timestamp, level and caller params determine if those fields are reported. If timestamp is true and utc is also true, the timestamp is displayed in UTC time. The addCallerSkip param is used to adjust the frame reported as the caller.
func (*Log) AddCallerSkip ¶
AddCallerSkip adds additional caller skip.