Documentation
¶
Overview ¶
Package zaptest implements test helpers that facilitate using a zap.Logger in unit tests.
This package is useful when running unit tests with components that use the github.com/uber-go/zap logging framework. In unit tests we usually want to suppress any logging output as long as the tests are not failing or they are started in a verbose mode.
Package zaptest is also compatible with the github.com/onsi/ginkgo BDD testing framework. Have a look at the zaptest unit tests to see an usage examples.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Config = func() zapcore.EncoderConfig { conf := zap.NewDevelopmentEncoderConfig() conf.EncodeTime = func(t time.Time, enc zapcore.PrimitiveArrayEncoder) {} return conf }
Config is the default function used create the configuration for the zap logger. You can change this if you want to change the logger encoding options.
By default the zap development config will be used and timestamps will be omitted (just like normal t.Log does).
var Level = zap.DebugLevel
Level is the zap log level that will be printed in unit tests.
Functions ¶
Types ¶
This section is empty.
