1
0
mirror of https://github.com/rs/zerolog synced 2026-06-08 17:13:30 +00:00

17 Commits

Author SHA1 Message Date
Marc Brooks 0cf9361666 Fix missing context.Context in Object/EmbedObject (#737)
Copies over event settings for ctx, hooks, and stack

- Fix missing context for Event.appendObjects passes event's stack, ctx, and hooks (ch).
- Add Array.Errs support.
- Context.Errs, Event.Errs,  use new Array.Errs()
- Array.Err handles nil correctly.
- Fix Event.Err code ignoring modified event in ErrorStackMarshaler handling.
- Fix Fields.appendFieldList when ErrorMarshalFunc returns a nil.
- Fields.appendFieldList does no longer adds the ErrorStackFieldName field when ErrorStackMarshaler returns nil.
- Don't call the ErrorMarshalFunc on nil errors.
- Removed unreachable code NOP in Context.Array
- Rewrite ErrorMarshalFunc testing.
- Made diode tests more stable.
- Log copy error in test.
- Address review comments
- Added CreateArray() and CreateDict() for both Context and Event and deprecate the Arr() and Dict().
Array now carries then stack/context/hooks so they are available to LogObjectMarshal of Array elements.
Added unit tests for error marshal that returns an interface{}
2026-01-05 18:19:15 +00:00
Andrey36652 04ea0f4371 Implement Close() for zerolog.FilteredLevelWriter (#715) 2025-03-12 13:16:56 +01:00
Garret Buell 4d78dc5ffa Add forwarding close methods to several writer implementations (#636) 2024-01-13 19:08:26 +01:00
Garret Buell c1ab4ed9bf Make Log.Fatal() call Close on the writer before os.Exit(1) (#634) 2024-01-13 10:25:59 +01:00
Vitalii Solodilov a9ec232b3e Add stacktrace to Context (#630) 2024-01-03 05:40:23 +01:00
Sami Kerola 83e03c75d9 stop using deprecated io/ioutils package (#620) (#620) 2023-11-24 22:16:01 +01:00
Donald Nguyen 315967f32d Avoid race in diode.Close with waiter (#481) 2022-09-15 10:15:42 +02:00
nichady c0c2e11fc3 Consistent casing, redundancy, and spelling/grammar (#391)
* fix casing
* remove redundant type conversions
* remove unnecessary append
x = append(y) is equivalent to x = y
* fix grammar and spelling
* rename file to enforce consistent casing with other READMEs in this repo
2021-12-21 13:07:54 +01:00
Mikhail Lukianchenko 72acd6cfe8 Fix typo in diode.NewWriter argument name (#254) 2020-08-06 12:19:27 +02:00
Jean-Sébastien Didierlaurent e86e8f2f49 fix(diode): atomic.AddUint64 in 32-bit cause panic (#229)
see: https://golang.org/pkg/sync/atomic/#pkg-note-BUG
2020-05-11 11:49:43 -07:00
Olivier Poitrey 51c79ca476 Fix com typo 2018-11-02 13:06:29 -07:00
Olivier Poitrey e7627a4f73 diode: let use a waiter instead of a poller by using 0 as a poolInterval 2018-10-31 16:57:15 -07:00
Olivier Poitrey e0f8de6c35 Fix usage of sync.Pool
The current usage of sync.Pool is leaky because it stores an arbitrary
sized buffer into the pool. However, sync.Pool assumes that all items in the
pool are interchangeable from a memory cost perspective. Due to the unbounded
size of a buffer that may be added, it is possible for the pool to eventually
pin arbitrarily large amounts of memory in a live-lock situation.

As a simple fix, we just set a maximum size that we permit back into the pool.
2018-09-19 00:20:01 -07:00
Rafael Passos c19f1e5eed Diode module Documentation update (#71)
* Updated Diode example to match new style

* DOC: changed w to wr in assigment to reduce ambiguity
2018-05-25 14:45:33 -07:00
Olivier Poitrey 77db4b4f35 Embed the diode lib to avoid test dependencies
This commit introduces a breaking change in the diode API in order to
hide the diodes package interface. This removes a good number of
dependencies introduced by the test framework used by the diodes
package.
2018-05-24 19:15:40 -07:00
Ravi Raju ddfae1b613 Binary format support (#37)
Adds support for binary logging (with cbor encoding) in addition to JSON. Use the binary_log compile tag to enable the feature.
2018-03-28 11:49:41 -07:00
Olivier Poitrey 8c1c6a0cd7 Add diode.Writer, a thread-safe, lock-free, non-blocking writer wrapper 2018-02-20 02:33:26 -08:00