Bugfixes:
zap.NewNop
.Enhancements:
zapcore.BufferedWriteSyncer
, a new WriteSyncer
that buffers messages in-memory and flushes them periodically.zapio.Writer
to use a Zap logger as an io.Writer
.zap.WithClock
option to control the source of time via the new zapcore.Clock
interface.zap.SugaredLogger
when arguments of *w
methods don't match expectations.zaptest/observer
.io.StringWriter
and io.ByteWriter
in Zap's buffer.Buffer
.Thanks to @atrn0, @ernado, @heyanfu, @hnlq715, @zchee for their contributions to this release.
Bugfixes:
<nil>
for nil error
instead of a panic.Enhancements:
grpclog.LoggerV2
in zapgrpc.application/x-www-form-urlencoded
content type.zap.Inline
.zaptest/observer
.Thanks to @ash2k, @FMLS, @jimmystewpot, @Oncilla, @tsoslow, @tylitianrui, @withshubh, and @wziww for their contributions to this release.
Bugfixes:
0666
and rely on the umask instead.<nil>
for nil Stringer
instead of a panic error log.Enhancements:
zapcore.TimeEncoderOfLayout
to easily create time encoders for custom layouts.StackSkip
for including truncated stacks as a field.Thanks to @SteelPhase, @tmshn, @lixingwang, @wyxloading, @moul, @segevfiner, @andy-retailnext and @jcorbin for their contributions to this release.
Bugfixes:
Time
values out of UnixNano
range.IncreaseLevel
being reset after a call to With
.Enhancements:
WithCaller
option to supersede the AddCaller
option. This allows disabling annotation of log entries with caller information if previously enabled with AddCaller
.NewSampler
constructor in favor of NewSamplerWithOptions
which supports a SamplerHook
option. This option adds support for monitoring sampling decisions through a hook.Thanks to @danielbprice for their contributions to this release.
Bugfixes:
go mod vendor
no longer includes Zap's development-time dependencies.time.Time
objects when using string-based time formats.Thanks to @YashishDua for their contributions to this release.
Enhancements:
Time.AppendFormat
where possible.Thanks to @caibirdme for their contributions to this release.
Enhancements:
Intp
, Stringp
, and other similar *p
field constructors to log pointers to primitives with support for nil
values.Thanks to @jbizzle for their contributions to this release.
Enhancements:
Enhancements:
zapcore.OmitKey
to omit keys in an EncoderConfig
.RFC3339
and RFC3339Nano
time encoders.Thanks to @juicemia, @uhthomas for their contributions to this release.
Bugfixes:
MapObjectEncoder.AppendByteString
not adding value as a string.Enhancements:
zaptest.WrapOptions
to wrap zap.Option
for creating test loggers.Thanks to @iaroslav-ciupin, @lelenanam, @joa, @NWilson for their contributions to this release.
Bugfixes:
Enhancements:
Thanks to @nfarah86, @AlekSi, @JeanMertz, @philippgille, @etsangsplk, and @dimroc for their contributions to this release.
Enhancements:
*testing.TB
.zapcore.Field
to clean up GoDoc.Bugfixes:
go.uber.org/zap/buffer
.Thanks to @DiSiqueira and @djui for their contributions to this release.
Bugfixes:
Enhancements:
NewStdLogAt
, which extends NewStdLog
by allowing the user to specify the level of the logged messages.Enhancements:
ContextMap
method to observer logs for simpler field validation in tests.Enhancements:
go.uber.org/multierr
.Bugfixes:
Thanks to @richard-tunein and @pavius for their contributions to this release.
This release fixes two bugs.
Bugfixes:
This release adds a few small features and is fully backward-compatible.
Enhancements:
LineEnding
field to EncoderConfig
, allowing users to override the Unix-style default.zap.AtomicLevel
implement fmt.Stringer
, which makes a variety of operations a bit simpler.This release adds an enhancement to zap's testing helpers as well as the ability to marshal an AtomicLevel. It is fully backward-compatible.
Enhancements:
SugaredLogger
.AtomicLevel
implement encoding.TextMarshaler
.This release adds a gRPC compatibility wrapper. It is fully backward-compatible.
Enhancements:
zapgrpc
package that wraps zap's Logger and implements grpclog.Logger
.This release fixes two bugs and adds some enhancements to zap's testing helpers. It is fully backward-compatible.
Bugfixes:
Enhancements:
Thanks to @moitias for contributing to this release.
This is zap's first stable release. All exported APIs are now final, and no further breaking changes will be made in the 1.x release series. Anyone using a semver-aware dependency manager should now pin to ^1
.
Breaking changes:
[]byte
to string
.Sync
methods to zapcore.Core
, zap.Logger
, and zap.SugaredLogger
.testutils
package to zaptest
, which is less likely to clash with other testing helpers.Bugfixes:
zapcore.NewCore
, which allows zap to work with concurrency-safe WriteSyncer
implementations.fsync
standard out on Linux systems.Enhancements:
Config
.CombineWriteSyncers
, a convenience function to tee multiple WriteSyncer
s and lock the result.zaptest/observer
. This makes it easier for particularly punctilious users to unit test their application's logging.Thanks to @suyash, @htrendev, @flisky, @Ulexus, and @skipor for their contributions to this release.
This is the third release candidate for zap's stable release. There are no breaking changes.
Bugfixes:
zap.Any
are now correctly treated as binary blobs rather than []uint8
.Enhancements:
log.Logger
instance.Thanks to @ansel1 and @suyash for their contributions to this release.
This is the second release candidate for zap's stable release. It includes two breaking changes.
Breaking changes:
#316: Zap's global loggers are now fully concurrency-safe (previously, users had to ensure that ReplaceGlobals
was called before the loggers were in use). However, they must now be accessed via the L()
and S()
functions. Users can update their projects with
gofmt -r "zap.L -> zap.L()" -w . gofmt -r "zap.S -> zap.S()" -w .
#309 and #317: RC1 was mistakenly shipped with invalid JSON and YAML struct tags on all config structs. This release fixes the tags and adds static analysis to prevent similar bugs in the future.
Bugfixes:
log
output now correctly reports the logger's caller.Enhancements:
github.com/pkg/errors
.New(nil)
continues to return a no-op logger, NewNop()
is now preferred. Users can update their projects with gofmt -r 'zap.New(nil) -> zap.NewNop()' -w .
.github.com/uber-go/zap
now returns a more informative error.Thanks to @skipor and @chapsuk for their contributions to this release.
This is the first release candidate for zap's stable release. There are multiple breaking changes and improvements from the pre-release version. Most notably:
zap
package. Code relevant largely to extension authors is now in the zapcore
package.zapcore.Core
type makes it easy for third-party packages to use zap's internals but provide a different user-facing API.Logger
is now a concrete type instead of an interface.L
and S
are included.This is a minor version, tagged to allow users to pin to the pre-1.0 APIs and upgrade at their leisure. Since this is the first tagged release, there are no backward compatibility concerns and all functionality is new.
Early zap adopters should pin to the 0.1.x minor version until they're ready to upgrade to the upcoming stable release.