New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zapcore: Add Buffered Writer #961
Commits on May 25, 2021
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Update zapcore/write_syncer.go
Co-authored-by: Prashant Varanasi <github@prashantv.com>
-
-
-
-
-
Update zapcore/write_syncer.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Update zapcore/write_syncer_test.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Update zapcore/write_syncer_test.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Update zapcore/write_syncer_test.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Update zapcore/write_syncer_test.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Update zapcore/write_syncer_test.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Update zapcore/write_syncer_test.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
-
We'd like to avoid introducing a new top-level type if we can. Delete the CloseFunc type in favor of returning a naked `func() error`.
-
-
-
Buffer/close: return a bound method
Instead of returning an anonmyous function, return a bound method. The bound method is named `close`, not `Close` to avoid accidentally exposing an `io.Closer` interface.
-
Buffer/close: Close the channel instead of posting
For the channel that signals end of the goroutine, we should close it instead of posting a single value to it.
-
-
buffer: Move loop into a method
Move the flush loop into its own method instead of spawning it in a closure.
-
On close, stop the ticker from posting ticks to the channel.
-
Update zapcore/write_syncer_test.go
Co-authored-by: Prashant Varanasi <github@prashantv.com>
-
-
Update zapcore/write_syncer.go
Co-authored-by: Prashant Varanasi <github@prashantv.com>
-
Update zapcore/write_syncer.go
Co-authored-by: Prashant Varanasi <github@prashantv.com>
-
Update zapcore/write_syncer.go
Co-authored-by: Prashant Varanasi <github@prashantv.com>
-
-
Update zapcore/write_syncer.go
Co-authored-by: Prashant Varanasi <github@prashantv.com>
-
Update zapcore/write_syncer.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
-
-
-
-
-
-
Commits on Jun 1, 2021
-
Set default Clock zapcore/buffered_write_syncer.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Use require instead assert zapcore/buffered_write_syncer_bench_test.go
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Update Close() comment, use filepath to create tmpDir and mutate Cloc…
…k on loadConfig if needed
-
Commits on Jun 4, 2021
Commits on Jun 8, 2021
-
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Use zapcore.Lock for BufferedWriteSyncer tests
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
-
Add asserts on close/remove in benchmark buffered write and add test …
…case for wrap twice sync
-
-
-
-
-
-
Stop/Sync: handle uninitialized calls
These methods should not panic if called without `Write` first (which is what starts the background goroutine).
-
Rename WriteSyncer field to WS
Writing `BufferedWriteSyncer{WriteSyncer: ...}` is a mouthful. Let's go for something short and obvious like: ``` package io type LimitedReader struct { R Reader // underlying reader N int64 // max bytes remaining } ```
-
-