feat(logger): implement async logger#985
Merged
xu282934741 merged 7 commits intokubewharf:mainfrom Nov 11, 2025
Merged
Conversation
9f850db to
66c2d4b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #985 +/- ##
==========================================
- Coverage 59.70% 59.70% -0.01%
==========================================
Files 682 683 +1
Lines 63844 63881 +37
==========================================
+ Hits 38117 38138 +21
- Misses 21322 21336 +14
- Partials 4405 4407 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
314fb9a to
7d6b5bd
Compare
067657d to
af06886
Compare
af06886 to
70ecc3e
Compare
junyu-peng
reviewed
Oct 17, 2025
2da90cc to
3a74795
Compare
100a8ba to
986347c
Compare
junyu-peng
reviewed
Oct 22, 2025
feat: implement async logger feat: implement async logger
chore: unit tests chore: unit tests
feat: split up logs based on severity feat: split up logs based on severity feat: split up logs based on severity feat: split up logs based on severity feat: split up logs based on severity
feat: add cleanup parameters in async logging feat: add cleanup parameters in async logging
fix: PR comments fix: PR comments fix: PR comments fix: PR comments fix: PR comments fix: PR comments fix: PR comments fix: PR comments fix: PR comments fix: PR comments fix: PR comments
feat: make logger more dynamic by allowing synchronous lumberjack feat: make logger more dynamic by allowing synchronous lumberjack feat: make logger more dynamic by allowing synchronous lumberjack feat: make logger more dynamic by allowing synchronous lumberjack feat: make logger more dynamic by allowing synchronous lumberjack
2e31a90 to
533503c
Compare
yehlemias
reviewed
Nov 4, 2025
| // Enable async logger if buffer size is more than 0; otherwise, use synchronous lumberjack logger | ||
| if bufferSize > 0 { | ||
| // diodeWriter is a writer that stores logs in a ring buffer and asynchronously flushes them to disk | ||
| diodeWriter := diode.NewWriter(lumberjackLogger, bufferSize, 10*time.Millisecond, func(missed int) { |
Collaborator
There was a problem hiding this comment.
why using poller rather than waiter?
Collaborator
Author
There was a problem hiding this comment.
Polling performs better with high frequency logs; for waiting, the high frequency of logs will likely cause high frequency of context switching for waking up goroutines at every log, probably leading to high overhead.
xu282934741
approved these changes
Nov 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
We want to optimise async klog's native logging mechanism by making the write function asynchronous.
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for your reviewer: