-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Comparing changes
Open a pull request
base repository: uber-go/zap
base: v1.17.0
head repository: uber-go/zap
compare: v1.19.1
Commits on Jan 8, 2021
-
Add WithClock option to control the source of time for logged entries. Fixes #694 Co-authored-by: Abhinav Gupta <abg@uber.com>
Configuration menu - View commit details
-
Copy full SHA for f8ef926 - Browse repository at this point
Copy the full SHA f8ef926View commit details
Commits on Feb 2, 2021
-
http: support additional content type (#903)
Support `application/x-www-form-urlencoded` as an additional content type for `AtomicLevel.ServeHTTP`. This is the default content type for `curl -X POST`. With this change, interacting with the HTTP endpoint is a bit more user friendly: ``` curl -X PUT localhost:8080/log/level -d level=debug ``` Additionally, the unit tests for the HTTP handler are transformed to a table driven approach. fixes #902 Co-authored-by: Abhinav Gupta <abg@uber.com>
Configuration menu - View commit details
-
Copy full SHA for b274f65 - Browse repository at this point
Copy the full SHA b274f65View commit details
Commits on Feb 3, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 89d9466 - Browse repository at this point
Copy the full SHA 89d9466View commit details
Commits on Feb 8, 2021
-
Optimize Sugar logger for calls with a single string arg (#913)
Currently, the Sugar logger uses fmt.Sprint in all cases when the template is empty. However, this call is unnecessary if there's a single string type argument, as we can use it directly. With this optimization, we reduce the cost and avoid an unnecessary alloc: ``` > benchcmp pre post benchmark old ns/op new ns/op delta BenchmarkSugarSingleStrArg-10 636 570 -10.38% benchmark old allocs new allocs delta BenchmarkSugarSingleStrArg-10 1 0 -100.00% ```
Configuration menu - View commit details
-
Copy full SHA for 4f6f7e9 - Browse repository at this point
Copy the full SHA 4f6f7e9View commit details
Commits on Feb 9, 2021
-
Configuration menu - View commit details
-
Copy full SHA for ab0cbad - Browse repository at this point
Copy the full SHA ab0cbadView commit details
Commits on Feb 12, 2021
-
tools: Move to submodule (#914)
This moves development tool dependencies to a subdirectory so that these are not added as dependencies of zap.
Configuration menu - View commit details
-
Copy full SHA for aecb309 - Browse repository at this point
Copy the full SHA aecb309View commit details -
Add support for grpclog.LoggerV2 (#881)
gRPC has an updated [logger interface][1] that the v1 API has been deprecated in favor of. [1]: https://pkg.go.dev/google.golang.org/grpc/grpclog#LoggerV2 This adds support for it to the existing gRPC adapter in Zap. Fixes #534 Closes #538 Co-authored-by: Prashant Varanasi <github@prashantv.com> Co-authored-by: Abhinav Gupta <abg@uber.com>
Configuration menu - View commit details
-
Copy full SHA for 89e3820 - Browse repository at this point
Copy the full SHA 89e3820View commit details
Commits on Mar 23, 2021
-
Support multi-field encoding using zap.Inline (#912)
Fixes #876 Currently, a `zap.Field` can only represent a single key-value. Add `zap.Inline` to allow adding multiple fields to the current namespace from a type implementing `zap.ObjectMarshaler`. This also solves a more general problem: a single `zap.Field` can now be used to add multiple key/value pairs.
Configuration menu - View commit details
-
Copy full SHA for ca7ddee - Browse repository at this point
Copy the full SHA ca7ddeeView commit details -
Add FilterFieldKey to zaptest/observer (#928)
Adds functionality to filter zap.Field by key. This makes testing for field existence regardless of value more convenient. resolves #816
Configuration menu - View commit details
-
Copy full SHA for bfa147a - Browse repository at this point
Copy the full SHA bfa147aView commit details
Commits on Mar 29, 2021
-
Update dependencies to fix vulnerabilities (#931)
- go.uber.org/atomic@1.6.0 - go.uber.org/multierr@1.5.0. Removes a lot of no longer needed dependencies and fixes vulnerabilities including the following: - golang.org/x/crypto (CVE-2020-9283) - golang.org/x/text (CVE-2020-14040)
Configuration menu - View commit details
-
Copy full SHA for c23abee - Browse repository at this point
Copy the full SHA c23abeeView commit details
Commits on Apr 20, 2021
-
zapcore: Cleanup copy in NewMultiWriteSyncer (#934)
The copy was originally in place due to golang/go#7809 Since that issue was fixed in Go 1.3 a few years ago, it seems safe to drop the copy.
Configuration menu - View commit details
-
Copy full SHA for 7b21229 - Browse repository at this point
Copy the full SHA 7b21229View commit details
Commits on May 17, 2021
-
Switch from Travis to GitHub Actions (#940)
We're deprecating use of Travis for our OSS projects, so switch to GitHub Actions for it. Unfortunately, this required dropping tests we had against ppc64le because [GitHub Workflows doesn't support it][1]. [1]: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#github-hosted-runners
Configuration menu - View commit details
-
Copy full SHA for d9a4dcc - Browse repository at this point
Copy the full SHA d9a4dccView commit details
Commits on May 18, 2021
-
Update dependencies to fix vulnerabilities in (#936)
- gopkg.in/yaml.v2 v2.2.2 -> v.2.2.8 CVE-2019-11254
Configuration menu - View commit details
-
Copy full SHA for 8b883c6 - Browse repository at this point
Copy the full SHA 8b883c6View commit details -
This utility allows creating a logger with "advanced" filters like in the following example. It is particularly convenient to use with a CLI flag package or using environment variables. core := zap.NewExample().Core() // *=myns => any level, myns namespace // info,warn:myns.* => info or warn level, any namespace matching myns.* // error=* => everything with error level logger := zap.New(zapfilter.NewFilteringCore(core, zapfilter.MustParseRules("*:myns info,warn:myns.* error:*"))) defer logger.Sync() logger.Debug("top debug") // no match logger.Named("myns").Debug("myns debug") // matches *:myns logger.Named("bar").Debug("bar debug") // no match logger.Named("myns").Named("foo").Debug("myns.foo debug") // no match logger.Info("top info") // no match logger.Named("myns").Info("myns info") // matches *:myns logger.Named("bar").Info("bar info") // no match logger.Named("myns").Named("foo").Info("myns.foo info") // matches info,warn:myns.* logger.Warn("top warn") // no match logger.Named("myns").Warn("myns warn") // matches *:myns logger.Named("bar").Warn("bar warn") // no match logger.Named("myns").Named("foo").Warn("myns.foo warn") // matches info,warn:myns.* logger.Error("top error") // matches error:* logger.Named("myns").Error("myns error") // matches *:myns and error:* logger.Named("bar").Error("bar error") // matches error:* logger.Named("myns").Named("foo").Error("myns.foo error") // matches error:* // Output: // {"level":"debug","logger":"myns","msg":"myns debug"} // {"level":"info","logger":"myns","msg":"myns info"} // {"level":"info","logger":"myns.foo","msg":"myns.foo info"} // {"level":"warn","logger":"myns","msg":"myns warn"} // {"level":"warn","logger":"myns.foo","msg":"myns.foo warn"} // {"level":"error","msg":"top error"} // {"level":"error","logger":"myns","msg":"myns error"} // {"level":"error","logger":"bar","msg":"bar error"} // {"level":"error","logger":"myns.foo","msg":"myns.foo error"}
Configuration menu - View commit details
-
Copy full SHA for f73286f - Browse repository at this point
Copy the full SHA f73286fView commit details -
internal/readme: Simplify if condition (#945)
Check for "both true" or "both false" is easily implemented as `x == y`.
Configuration menu - View commit details
-
Copy full SHA for debd2f1 - Browse repository at this point
Copy the full SHA debd2f1View commit details -
A recent change to dependencies neglected to run `go mod tidy`.
Configuration menu - View commit details
-
Copy full SHA for 3748251 - Browse repository at this point
Copy the full SHA 3748251View commit details
Commits on May 25, 2021
-
clock: Add Ticker support (#948)
In #897, we added a Clock interface to allow control over the source of time for operations that require accessing the current time. In #782, we discovered that this interface also needs the ability to construct tickers so that we can use it for the buffered writer. This change adds NewTicker to the Clock interface for Zap and moves it to the zapcore package as it will be needed for #782. Note that since we have not yet tagged a release of Zap with #897, this is not a breaking change. Co-authored-by: Minho Park <minho.park@uber.com> Co-authored-by: Abhinav Gupta <abg@uber.com>
Configuration menu - View commit details
-
Copy full SHA for dedcdad - Browse repository at this point
Copy the full SHA dedcdadView commit details -
We don't need to export the Clock interface from the top-level Zap package. This is a low-level API so we can keep it in zapcore only.
Configuration menu - View commit details
-
Copy full SHA for 7699673 - Browse repository at this point
Copy the full SHA 7699673View commit details -
lint: Check that 'go mod tidy' was run (#951)
In #948, we noticed that some `go.sum` files were outdated. To avoid this in the future, add a `lint` check that verifies that `go mod tidy` does not cause any changes. This will fail with a dirty working tree as well, but in CI, we don't expect that.
Configuration menu - View commit details
-
Copy full SHA for fec3dad - Browse repository at this point
Copy the full SHA fec3dadView commit details -
Add a FOSSA check to the build steps. Resolves: GO-468
Configuration menu - View commit details
-
Copy full SHA for 3c7c771 - Browse repository at this point
Copy the full SHA 3c7c771View commit details -
zapcore/FieldType: Don't change enum values (#955)
Although the values of the FieldType enums aren't part of the Zap contract, changing existing values is still a risky change. [apidiff] considers this a brekaing change. ``` Incompatible changes: - BinaryType: value changed from 3 to 4 - BoolType: value changed from 4 to 5 - ByteStringType: value changed from 5 to 6 - Complex128Type: value changed from 6 to 7 - Complex64Type: value changed from 7 to 8 - DurationType: value changed from 8 to 9 - ErrorType: value changed from 26 to 27 - Float32Type: value changed from 10 to 11 - Float64Type: value changed from 9 to 10 - Int16Type: value changed from 13 to 14 - Int32Type: value changed from 12 to 13 - Int64Type: value changed from 11 to 12 - Int8Type: value changed from 14 to 15 - NamespaceType: value changed from 24 to 25 - ReflectType: value changed from 23 to 24 - SkipType: value changed from 27 to 28 - StringType: value changed from 15 to 16 - StringerType: value changed from 25 to 26 - TimeFullType: value changed from 17 to 18 - TimeType: value changed from 16 to 17 - Uint16Type: value changed from 20 to 21 - Uint32Type: value changed from 19 to 20 - Uint64Type: value changed from 18 to 19 - Uint8Type: value changed from 21 to 22 - UintptrType: value changed from 22 to 23 ``` [apidiff]: https://github.com/golang/exp/blob/master/apidiff/README.md Again, although maintianing these values is not part of the Zap contract, in the interest of erring on the side of safety, I'm moving the new FieldType (added in #912) to the bottom to avoid changing the values of the other items.
Configuration menu - View commit details
-
Copy full SHA for 56304dc - Browse repository at this point
Copy the full SHA 56304dcView commit details -
fossa: Run separately, only on push (#957)
Currently, the FOSSA analysis is set to run as part of CI. Minus the fact that it's not really part of the build, its reliance on a secret means that it won't run for any pull requests made from external forks. Resolve this by running the FOSSA analysis only when we push to a branch of the Zap repository.
Configuration menu - View commit details
-
Copy full SHA for cfe34dc - Browse repository at this point
Copy the full SHA cfe34dcView commit details -
Merge v1.17.0 release into master
Release v1.17.0 omitted some changes that are present on master. Merge the release into master so that we can work off of that.
Configuration menu - View commit details
-
Copy full SHA for 4950e39 - Browse repository at this point
Copy the full SHA 4950e39View commit details
Commits on Jun 7, 2021
-
SugaredLogger/sweetenFields: Don't panic (#949)
SugaredLogger should not cause panics in user code. For keys without matching values or non-string keys, instead of panicking, log an error and move on. Resolves #896
Configuration menu - View commit details
-
Copy full SHA for 084fb2a - Browse repository at this point
Copy the full SHA 084fb2aView commit details
Commits on Jun 8, 2021
-
zaptest/ObservedLogs: Expose more filters (#943)
Currently consumers can call `(*ObservedLogs).All` and proceed to filter using `[]LoggedEntry` directly, but the result is then incompatible with existing methods such as `FilterMessage` because there is now way to re-construct an `*ObservedLogs` object. Add ObservedLogs.Filter and ObservedLogs.FilterLevelExact to allow filtering by arbitrary functions, or by exact level matches.
Configuration menu - View commit details
-
Copy full SHA for c05967d - Browse repository at this point
Copy the full SHA c05967dView commit details -
zapcore: Add Buffered Writer (#961)
Add a BufferedWriteSyncer that buffers writes in memory before flushing them to the underlying WriteSyncer at some interval or when a configured amount of data has been buffered -- whichever comes first. The bulk of this change was authored by hnlq715 and Moises Vega. Prashant and I contributed minor fixes. Co-authored-by: hnlq715 <hnlq.sysu@gmail.com> Co-authored-by: Prashant Varanasi <prashant@uber.com> Co-authored-by: Moises Vega <moises@uber.com>
Configuration menu - View commit details
-
Copy full SHA for aa3e73e - Browse repository at this point
Copy the full SHA aa3e73eView commit details
Commits on Jun 16, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 0c42722 - Browse repository at this point
Copy the full SHA 0c42722View commit details
Commits on Jun 24, 2021
-
Configuration menu - View commit details
-
Copy full SHA for fb71758 - Browse repository at this point
Copy the full SHA fb71758View commit details -
Add Buffer.WriteByte and WriteString methods (#691)
These methods are equivalent to `AppendByte` and `AppendString`, but their signatures are compatible with [bytes.Buffer](https://godoc.org/bytes#Buffer) and [bufio.Writer](https://godoc.org/bufio#Writer). This allows to use `Buffer` where `bytes.Buffer` was expected without extra cost of wrapping. One example is msgpack library which expects `Writer` to implement `WriteByte` and `WriteString`, otherwise it is wrapped which incurs extra allocation: https://github.com/vmihailenco/msgpack/blob/master/encode.go#L63-L67
Configuration menu - View commit details
-
Copy full SHA for 5afb307 - Browse repository at this point
Copy the full SHA 5afb307View commit details
Commits on Jun 25, 2021
-
This adds a new zapio package that provides a `Writer`. The writer implements `io.WriteCloser` and `zapcore.WriteSyncer`. It works by splitting the input on newlines, flushing to the logger as new lines are encountered, and buffering input otherwise. So for example, if write "foobar\n" is split across multiple Write calls "foo" and "bar\n", instead of emitting two separate logs for "foo" and "bar", the Writer will buffer the input until the newline is encountered and write a single log for "foobar". Performance: ``` name time/op Writer/single-4 384ns ± 3% Writer/splits-4 488ns ±26% name alloc/op Writer/single-4 16.0B ± 0% Writer/splits-4 16.0B ± 0% name allocs/op Writer/single-4 2.00 ± 0% Writer/splits-4 2.00 ± 0% ``` Resolves #929
Configuration menu - View commit details
-
Copy full SHA for d5c2a1a - Browse repository at this point
Copy the full SHA d5c2a1aView commit details
Commits on Jun 28, 2021
-
zapio/writer: More documentation and example test
Add more documentation and an example test for zapio.Writer to demonstrate its usage.
Configuration menu - View commit details
-
Copy full SHA for 1797f10 - Browse repository at this point
Copy the full SHA 1797f10View commit details -
This release contains the following API changes per apidiff: ``` --- go.uber.org/zap --- Compatible changes: - WithClock: added --- go.uber.org/zap/buffer --- Compatible changes: - (*Buffer).WriteByte: added - (*Buffer).WriteString: added --- go.uber.org/zap/zapcore --- Compatible changes: - BufferedWriteSyncer: added - Clock: added - DefaultClock: added --- go.uber.org/zap/zaptest/observer --- Compatible changes: - (*ObservedLogs).Filter: added - (*ObservedLogs).FilterLevelExact: added ``` In addition to that, this release contains the new `zapio` package which, being a completely new package, is also a compatible change.
Configuration menu - View commit details
-
Copy full SHA for 80f724f - Browse repository at this point
Copy the full SHA 80f724fView commit details -
Release v1.18.0 of Zap that contains several new features including: - `zapio.Writer` to treat a logger as an `io.Writer` - `zapcore.BufferedWriteSyncer` to buffer log writes in memory - `zap.Clock` to control the source of time - New filters on `zaptest/observer.Observer` This PR includes the release commit and some added documentation for `zapio.Writer`.
Configuration menu - View commit details
-
Copy full SHA for 35f15d1 - Browse repository at this point
Copy the full SHA 35f15d1View commit details -
NopLogger: Fix nil Clock panic
In #897, we added a `zap.Clock` option to control the source of time but neglected to set this field on the logger constructed by `zap.NewNop`. This has the effect of panicking the Nop logger with a nil dereference. Fix the nil dereference and add checks for the behavior of the Nop logger. Verified that these are the only instantiations of `Logger` in this package: ``` $ rg '\bLogger\{' *.go logger_test.go 67: for _, logger := range []*Logger{grandparent, parent, child} { logger.go 71: log := &Logger{ 86: return &Logger{ ``` Refs GO-684
Configuration menu - View commit details
-
Copy full SHA for 7ea57ce - Browse repository at this point
Copy the full SHA 7ea57ceView commit details -
This tags a patch release of the breakage introduced in 1.18.0.
Configuration menu - View commit details
-
Copy full SHA for a779980 - Browse repository at this point
Copy the full SHA a779980View commit details -
This releases a fix for the NopLogger breakage accidentally introduced in v1.18.0.
Configuration menu - View commit details
-
Copy full SHA for 120b08c - Browse repository at this point
Copy the full SHA 120b08cView commit details
Commits on Jul 1, 2021
-
Discard counters for out-of-bounds levels (#975)
Previously this just crashed. Co-authored-by: Prashant Varanasi <prashant@uber.com>
Configuration menu - View commit details
-
Copy full SHA for 007a55e - Browse repository at this point
Copy the full SHA 007a55eView commit details
Commits on Jul 5, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 42e70dd - Browse repository at this point
Copy the full SHA 42e70ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1cac10b - Browse repository at this point
Copy the full SHA 1cac10bView commit details
Commits on Jul 30, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 81879d1 - Browse repository at this point
Copy the full SHA 81879d1View commit details -
Optimize size of BufferedWriteSyncer by moving stopped bool field (#984)
Keeping the 2 `bool` fields next to each other avoids wasting an additional word.
Configuration menu - View commit details
-
Copy full SHA for 2198a43 - Browse repository at this point
Copy the full SHA 2198a43View commit details
Commits on Aug 9, 2021
-
Configuration menu - View commit details
-
Copy full SHA for c8e813e - Browse repository at this point
Copy the full SHA c8e813eView commit details
Commits on Aug 13, 2021
-
Configuration menu - View commit details
-
Copy full SHA for d8fd848 - Browse repository at this point
Copy the full SHA d8fd848View commit details
Commits on Sep 8, 2021
-
json: Fix encoding complex with negative i (#1001)
Fix encoding of complex numbers with negative imaginary components. Previously, `2 - 3i` was encoded as the following: 2+-3i Instead of the following: 2-3i Fix this by handling negative imaginary components correctly. Fixes #995
Configuration menu - View commit details
-
Copy full SHA for 914c4ff - Browse repository at this point
Copy the full SHA 914c4ffView commit details -
json: Fix float32 encoding and add test (#1003)
This commit fixes incorrect float32 encoding. A test case is also added. Refs: * #1002 * Internal ticket: GO-860
Configuration menu - View commit details
-
Copy full SHA for 305c249 - Browse repository at this point
Copy the full SHA 305c249View commit details -
This commit adds an unreleased section to the changelog to track things that need to be released. It also lists the unreleased changes since the last release to this section.
Configuration menu - View commit details
-
Copy full SHA for 0944a26 - Browse repository at this point
Copy the full SHA 0944a26View commit details -
Preparing release v1.19.1 (#1005)
This commit updates the changelog with release notes for v1.19.1.
Configuration menu - View commit details
-
Copy full SHA for eaeb0fc - Browse repository at this point
Copy the full SHA eaeb0fcView commit details
There are no files selected for viewing