github uber-go/zap v1.22.0

latest releases: exp/v0.3.0, v1.27.0, v1.26.0...
2 years ago

Enhancements:

  • #1071: Add zap.Objects and zap.ObjectValues field constructors to log
    arrays of objects. With these two constructors, you don't need to implement
    zapcore.ArrayMarshaler for use with zap.Array if those objects implement
    zapcore.ObjectMarshaler.
  • #1079: Add SugaredLogger.WithOptions to build a copy of an existing
    SugaredLogger with the provided options applied.
  • #1080: Add *ln variants to SugaredLogger for each log level.
    These functions provide a string joining behavior similar to fmt.Println.
  • #1088: Add zap.WithFatalHook option to control the behavior of the
    logger for Fatal-level log entries. This defaults to exiting the program.
  • #1108: Add a zap.Must function that you can use with NewProduction or
    NewDevelopment to panic if the system was unable to build the logger.
  • #1118: Add a Logger.Log method that allows specifying the log level for
    a statement dynamically.

Thanks to @cardil, @craigpastro, @sashamelentyev, @shota3506, and @zhupeijun
for their contributions to this release.

Don't miss a new zap release

NewReleases is sending notifications on new releases.