Documentation ¶
Overview ¶
Package zap sets up a zap.Logger using the Zap logging framework. This implementation contains configurable options including log levels, stack trace levels, encoders, and caller skip levels.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseLogLevel ¶
func ParseLogLevel(logLevel string) (zap.AtomicLevel, error)
ParseLogLevel accepts either a capitalized or lower cased string for the log level. Accepts one of "debug", "info", "warn", "error", "panic", or "fatal". Returns zap.InfoLevel on an error.
Types ¶
type Opts ¶
type Opts func(*options)
Opts allows manipulation of the Zap options.
func AddCallerSkip ¶
AddCallerSkip increases the number of callers skipped by caller annotation, supplying this Option prevents zap from always reporting the wrapper code as the caller.
func Encoder ¶
Encoder configures how the logger will encode the output e.g console, JSON. See Options.Encoder.
func Level ¶
func Level(level *zap.AtomicLevel) Opts
Level sets the the minimum enabled logging level e.g Debug, Info, Warn, Error. See Options.Level.
func RawOptions ¶
RawOptions allows appending additional zap.Options. See Options.ZapOptions.
func StacktraceLevel ¶
func StacktraceLevel(stacktraceLevel *zap.AtomicLevel) Opts
StacktraceLevel configures the logger to record a stack trace for all messages at or above the given level. See Options.StacktraceLevel.