zap v1.23.0 Release Notes
Release Date: 2022-08-24 // over 2 years agoPrevious changes from v1.22.0
-
โจ Enhancements:
- ๐ฒ #1071: Add
zap.Objects
andzap.ObjectValues
field constructors to log arrays of objects. With these two constructors, you don't need to implementzapcore.ArrayMarshaler
for use withzap.Array
if those objects implementzapcore.ObjectMarshaler
. - ๐ #1079: Add
SugaredLogger.WithOptions
to build a copy of an existingSugaredLogger
with the provided options applied. - ๐ฒ #1080: Add
*ln
variants toSugaredLogger
for each log level. These functions provide a string joining behavior similar tofmt.Println
. - #1088: Add
zap.WithFatalHook
option to control the behavior of the logger forFatal
-level log entries. This defaults to exiting the program. - #1108: Add a
zap.Must
function that you can use withNewProduction
orNewDevelopment
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.
- ๐ฒ #1071: Add