1# Changelog 2 3## 1.13.0 (13 Nov 2019) 4 5Enhancements: 6* [#758][]: Add `Intp`, `Stringp`, and other similar `*p` field constructors 7 to log pointers to primitives with support for `nil` values. 8 9Thanks to @jbizzle for their contributions to this release. 10 11## 1.12.0 (29 Oct 2019) 12 13Enhancements: 14* [#751][]: Migrate to Go modules. 15 16## 1.11.0 (21 Oct 2019) 17 18Enhancements: 19* [#725][]: Add `zapcore.OmitKey` to omit keys in an `EncoderConfig`. 20* [#736][]: Add `RFC3339` and `RFC3339Nano` time encoders. 21 22Thanks to @juicemia, @uhthomas for their contributions to this release. 23 24## 1.10.0 (29 Apr 2019) 25 26Bugfixes: 27* [#657][]: Fix `MapObjectEncoder.AppendByteString` not adding value as a 28 string. 29* [#706][]: Fix incorrect call depth to determine caller in Go 1.12. 30 31Enhancements: 32* [#610][]: Add `zaptest.WrapOptions` to wrap `zap.Option` for creating test 33 loggers. 34* [#675][]: Don't panic when encoding a String field. 35* [#704][]: Disable HTML escaping for JSON objects encoded using the 36 reflect-based encoder. 37 38Thanks to @iaroslav-ciupin, @lelenanam, @joa, @NWilson for their contributions 39to this release. 40 41## v1.9.1 (06 Aug 2018) 42 43Bugfixes: 44 45* [#614][]: MapObjectEncoder should not ignore empty slices. 46 47## v1.9.0 (19 Jul 2018) 48 49Enhancements: 50* [#602][]: Reduce number of allocations when logging with reflection. 51* [#572][], [#606][]: Expose a registry for third-party logging sinks. 52 53Thanks to @nfarah86, @AlekSi, @JeanMertz, @philippgille, @etsangsplk, and 54@dimroc for their contributions to this release. 55 56## v1.8.0 (13 Apr 2018) 57 58Enhancements: 59* [#508][]: Make log level configurable when redirecting the standard 60 library's logger. 61* [#518][]: Add a logger that writes to a `*testing.TB`. 62* [#577][]: Add a top-level alias for `zapcore.Field` to clean up GoDoc. 63 64Bugfixes: 65* [#574][]: Add a missing import comment to `go.uber.org/zap/buffer`. 66 67Thanks to @DiSiqueira and @djui for their contributions to this release. 68 69## v1.7.1 (25 Sep 2017) 70 71Bugfixes: 72* [#504][]: Store strings when using AddByteString with the map encoder. 73 74## v1.7.0 (21 Sep 2017) 75 76Enhancements: 77 78* [#487][]: Add `NewStdLogAt`, which extends `NewStdLog` by allowing the user 79 to specify the level of the logged messages. 80 81## v1.6.0 (30 Aug 2017) 82 83Enhancements: 84 85* [#491][]: Omit zap stack frames from stacktraces. 86* [#490][]: Add a `ContextMap` method to observer logs for simpler 87 field validation in tests. 88 89## v1.5.0 (22 Jul 2017) 90 91Enhancements: 92 93* [#460][] and [#470][]: Support errors produced by `go.uber.org/multierr`. 94* [#465][]: Support user-supplied encoders for logger names. 95 96Bugfixes: 97 98* [#477][]: Fix a bug that incorrectly truncated deep stacktraces. 99 100Thanks to @richard-tunein and @pavius for their contributions to this release. 101 102## v1.4.1 (08 Jun 2017) 103 104This release fixes two bugs. 105 106Bugfixes: 107 108* [#435][]: Support a variety of case conventions when unmarshaling levels. 109* [#444][]: Fix a panic in the observer. 110 111## v1.4.0 (12 May 2017) 112 113This release adds a few small features and is fully backward-compatible. 114 115Enhancements: 116 117* [#424][]: Add a `LineEnding` field to `EncoderConfig`, allowing users to 118 override the Unix-style default. 119* [#425][]: Preserve time zones when logging times. 120* [#431][]: Make `zap.AtomicLevel` implement `fmt.Stringer`, which makes a 121 variety of operations a bit simpler. 122 123## v1.3.0 (25 Apr 2017) 124 125This release adds an enhancement to zap's testing helpers as well as the 126ability to marshal an AtomicLevel. It is fully backward-compatible. 127 128Enhancements: 129 130* [#415][]: Add a substring-filtering helper to zap's observer. This is 131 particularly useful when testing the `SugaredLogger`. 132* [#416][]: Make `AtomicLevel` implement `encoding.TextMarshaler`. 133 134## v1.2.0 (13 Apr 2017) 135 136This release adds a gRPC compatibility wrapper. It is fully backward-compatible. 137 138Enhancements: 139 140* [#402][]: Add a `zapgrpc` package that wraps zap's Logger and implements 141 `grpclog.Logger`. 142 143## v1.1.0 (31 Mar 2017) 144 145This release fixes two bugs and adds some enhancements to zap's testing helpers. 146It is fully backward-compatible. 147 148Bugfixes: 149 150* [#385][]: Fix caller path trimming on Windows. 151* [#396][]: Fix a panic when attempting to use non-existent directories with 152 zap's configuration struct. 153 154Enhancements: 155 156* [#386][]: Add filtering helpers to zaptest's observing logger. 157 158Thanks to @moitias for contributing to this release. 159 160## v1.0.0 (14 Mar 2017) 161 162This is zap's first stable release. All exported APIs are now final, and no 163further breaking changes will be made in the 1.x release series. Anyone using a 164semver-aware dependency manager should now pin to `^1`. 165 166Breaking changes: 167 168* [#366][]: Add byte-oriented APIs to encoders to log UTF-8 encoded text without 169 casting from `[]byte` to `string`. 170* [#364][]: To support buffering outputs, add `Sync` methods to `zapcore.Core`, 171 `zap.Logger`, and `zap.SugaredLogger`. 172* [#371][]: Rename the `testutils` package to `zaptest`, which is less likely to 173 clash with other testing helpers. 174 175Bugfixes: 176 177* [#362][]: Make the ISO8601 time formatters fixed-width, which is friendlier 178 for tab-separated console output. 179* [#369][]: Remove the automatic locks in `zapcore.NewCore`, which allows zap to 180 work with concurrency-safe `WriteSyncer` implementations. 181* [#347][]: Stop reporting errors when trying to `fsync` standard out on Linux 182 systems. 183* [#373][]: Report the correct caller from zap's standard library 184 interoperability wrappers. 185 186Enhancements: 187 188* [#348][]: Add a registry allowing third-party encodings to work with zap's 189 built-in `Config`. 190* [#327][]: Make the representation of logger callers configurable (like times, 191 levels, and durations). 192* [#376][]: Allow third-party encoders to use their own buffer pools, which 193 removes the last performance advantage that zap's encoders have over plugins. 194* [#346][]: Add `CombineWriteSyncers`, a convenience function to tee multiple 195 `WriteSyncer`s and lock the result. 196* [#365][]: Make zap's stacktraces compatible with mid-stack inlining (coming in 197 Go 1.9). 198* [#372][]: Export zap's observing logger as `zaptest/observer`. This makes it 199 easier for particularly punctilious users to unit test their application's 200 logging. 201 202Thanks to @suyash, @htrendev, @flisky, @Ulexus, and @skipor for their 203contributions to this release. 204 205## v1.0.0-rc.3 (7 Mar 2017) 206 207This is the third release candidate for zap's stable release. There are no 208breaking changes. 209 210Bugfixes: 211 212* [#339][]: Byte slices passed to `zap.Any` are now correctly treated as binary blobs 213 rather than `[]uint8`. 214 215Enhancements: 216 217* [#307][]: Users can opt into colored output for log levels. 218* [#353][]: In addition to hijacking the output of the standard library's 219 package-global logging functions, users can now construct a zap-backed 220 `log.Logger` instance. 221* [#311][]: Frames from common runtime functions and some of zap's internal 222 machinery are now omitted from stacktraces. 223 224Thanks to @ansel1 and @suyash for their contributions to this release. 225 226## v1.0.0-rc.2 (21 Feb 2017) 227 228This is the second release candidate for zap's stable release. It includes two 229breaking changes. 230 231Breaking changes: 232 233* [#316][]: Zap's global loggers are now fully concurrency-safe 234 (previously, users had to ensure that `ReplaceGlobals` was called before the 235 loggers were in use). However, they must now be accessed via the `L()` and 236 `S()` functions. Users can update their projects with 237 238 ``` 239 gofmt -r "zap.L -> zap.L()" -w . 240 gofmt -r "zap.S -> zap.S()" -w . 241 ``` 242* [#309][] and [#317][]: RC1 was mistakenly shipped with invalid 243 JSON and YAML struct tags on all config structs. This release fixes the tags 244 and adds static analysis to prevent similar bugs in the future. 245 246Bugfixes: 247 248* [#321][]: Redirecting the standard library's `log` output now 249 correctly reports the logger's caller. 250 251Enhancements: 252 253* [#325][] and [#333][]: Zap now transparently supports non-standard, rich 254 errors like those produced by `github.com/pkg/errors`. 255* [#326][]: Though `New(nil)` continues to return a no-op logger, `NewNop()` is 256 now preferred. Users can update their projects with `gofmt -r 'zap.New(nil) -> 257 zap.NewNop()' -w .`. 258* [#300][]: Incorrectly importing zap as `github.com/uber-go/zap` now returns a 259 more informative error. 260 261Thanks to @skipor and @chapsuk for their contributions to this release. 262 263## v1.0.0-rc.1 (14 Feb 2017) 264 265This is the first release candidate for zap's stable release. There are multiple 266breaking changes and improvements from the pre-release version. Most notably: 267 268* **Zap's import path is now "go.uber.org/zap"** — all users will 269 need to update their code. 270* User-facing types and functions remain in the `zap` package. Code relevant 271 largely to extension authors is now in the `zapcore` package. 272* The `zapcore.Core` type makes it easy for third-party packages to use zap's 273 internals but provide a different user-facing API. 274* `Logger` is now a concrete type instead of an interface. 275* A less verbose (though slower) logging API is included by default. 276* Package-global loggers `L` and `S` are included. 277* A human-friendly console encoder is included. 278* A declarative config struct allows common logger configurations to be managed 279 as configuration instead of code. 280* Sampling is more accurate, and doesn't depend on the standard library's shared 281 timer heap. 282 283## v0.1.0-beta.1 (6 Feb 2017) 284 285This is a minor version, tagged to allow users to pin to the pre-1.0 APIs and 286upgrade at their leisure. Since this is the first tagged release, there are no 287backward compatibility concerns and all functionality is new. 288 289Early zap adopters should pin to the 0.1.x minor version until they're ready to 290upgrade to the upcoming stable release. 291 292[#316]: https://github.com/uber-go/zap/pull/316 293[#309]: https://github.com/uber-go/zap/pull/309 294[#317]: https://github.com/uber-go/zap/pull/317 295[#321]: https://github.com/uber-go/zap/pull/321 296[#325]: https://github.com/uber-go/zap/pull/325 297[#333]: https://github.com/uber-go/zap/pull/333 298[#326]: https://github.com/uber-go/zap/pull/326 299[#300]: https://github.com/uber-go/zap/pull/300 300[#339]: https://github.com/uber-go/zap/pull/339 301[#307]: https://github.com/uber-go/zap/pull/307 302[#353]: https://github.com/uber-go/zap/pull/353 303[#311]: https://github.com/uber-go/zap/pull/311 304[#366]: https://github.com/uber-go/zap/pull/366 305[#364]: https://github.com/uber-go/zap/pull/364 306[#371]: https://github.com/uber-go/zap/pull/371 307[#362]: https://github.com/uber-go/zap/pull/362 308[#369]: https://github.com/uber-go/zap/pull/369 309[#347]: https://github.com/uber-go/zap/pull/347 310[#373]: https://github.com/uber-go/zap/pull/373 311[#348]: https://github.com/uber-go/zap/pull/348 312[#327]: https://github.com/uber-go/zap/pull/327 313[#376]: https://github.com/uber-go/zap/pull/376 314[#346]: https://github.com/uber-go/zap/pull/346 315[#365]: https://github.com/uber-go/zap/pull/365 316[#372]: https://github.com/uber-go/zap/pull/372 317[#385]: https://github.com/uber-go/zap/pull/385 318[#396]: https://github.com/uber-go/zap/pull/396 319[#386]: https://github.com/uber-go/zap/pull/386 320[#402]: https://github.com/uber-go/zap/pull/402 321[#415]: https://github.com/uber-go/zap/pull/415 322[#416]: https://github.com/uber-go/zap/pull/416 323[#424]: https://github.com/uber-go/zap/pull/424 324[#425]: https://github.com/uber-go/zap/pull/425 325[#431]: https://github.com/uber-go/zap/pull/431 326[#435]: https://github.com/uber-go/zap/pull/435 327[#444]: https://github.com/uber-go/zap/pull/444 328[#477]: https://github.com/uber-go/zap/pull/477 329[#465]: https://github.com/uber-go/zap/pull/465 330[#460]: https://github.com/uber-go/zap/pull/460 331[#470]: https://github.com/uber-go/zap/pull/470 332[#487]: https://github.com/uber-go/zap/pull/487 333[#490]: https://github.com/uber-go/zap/pull/490 334[#491]: https://github.com/uber-go/zap/pull/491 335[#504]: https://github.com/uber-go/zap/pull/504 336[#508]: https://github.com/uber-go/zap/pull/508 337[#518]: https://github.com/uber-go/zap/pull/518 338[#577]: https://github.com/uber-go/zap/pull/577 339[#574]: https://github.com/uber-go/zap/pull/574 340[#602]: https://github.com/uber-go/zap/pull/602 341[#572]: https://github.com/uber-go/zap/pull/572 342[#606]: https://github.com/uber-go/zap/pull/606 343[#614]: https://github.com/uber-go/zap/pull/614 344[#657]: https://github.com/uber-go/zap/pull/657 345[#706]: https://github.com/uber-go/zap/pull/706 346[#610]: https://github.com/uber-go/zap/pull/610 347[#675]: https://github.com/uber-go/zap/pull/675 348[#704]: https://github.com/uber-go/zap/pull/704 349[#725]: https://github.com/uber-go/zap/pull/725 350[#736]: https://github.com/uber-go/zap/pull/736 351[#751]: https://github.com/uber-go/zap/pull/751 352[#758]: https://github.com/uber-go/zap/pull/758 353