v1.22.0
Enhancements:
- #1071: Add
zap.Objectsandzap.ObjectValuesfield constructors to log
arrays of objects. With these two constructors, you don't need to implement
zapcore.ArrayMarshalerfor use withzap.Arrayif those objects implement
zapcore.ObjectMarshaler. - #1079: Add
SugaredLogger.WithOptionsto build a copy of an existing
SugaredLoggerwith the provided options applied. - #1080: Add
*lnvariants toSugaredLoggerfor each log level.
These functions provide a string joining behavior similar tofmt.Println. - #1088: Add
zap.WithFatalHookoption to control the behavior of the
logger forFatal-level log entries. This defaults to exiting the program. - #1108: Add a
zap.Mustfunction that you can use withNewProductionor
NewDevelopmentto panic if the system was unable to build the logger. - #1118: Add a
Logger.Logmethod that allows specifying the log level for
a statement dynamically.
Thanks to @cardil, @craigpastro, @sashamelentyev, @shota3506, and @zhupeijun
for their contributions to this release.