-
Notifications
You must be signed in to change notification settings - Fork 30
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
refactor: skip unwanted logs #120
Conversation
WalkthroughThe pull request introduces version 1.1.1 of the project, focusing on improvements to PebbleDB logging and synchronization mechanisms. A new Changes
Sequence DiagramsequenceDiagram
participant App
participant PebbleDB
participant Logger
App->>PebbleDB: Initialize DB
PebbleDB->>Logger: Set custom fatalLogger
App->>PebbleDB: Perform database operation
alt Sync Required
PebbleDB->>PebbleDB: Force disk sync
end
PebbleDB-->>App: Operation result
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
pebble.go (2)
75-75
: LGTM: Good separation of logging concernsThe addition of
fatalLogger
to prevent PebbleDB's internal logs from interfering with the application's logging system is a clean architectural solution. This ensures proper separation between database and application logging.
496-504
: Add documentation and address unused parametersWhile the implementation effectively achieves the goal of selective logging, consider these improvements:
- Add documentation explaining the selective logging strategy
- Address the unused parameters in
Infof
Apply this diff to improve the implementation:
type fatalLogger struct { pebble.Logger } +// Fatalf implements pebble.Logger interface, forwarding fatal logs to the default logger func (*fatalLogger) Fatalf(format string, args ...interface{}) { pebble.DefaultLogger.Fatalf(format, args...) } -func (*fatalLogger) Infof(format string, args ...interface{}) {} +// Infof implements pebble.Logger interface, intentionally suppressing info logs +func (*fatalLogger) Infof(_ string, _ ...interface{}) {}🧰 Tools
🪛 GitHub Check: golangci
[failure] 504-504:
unused-parameter: parameter 'format' seems to be unused, consider removing or renaming it as _ (revive)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md
(1 hunks)pebble.go
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- CHANGELOG.md
🧰 Additional context used
🪛 GitHub Check: golangci
pebble.go
[failure] 504-504:
unused-parameter: parameter 'format' seems to be unused, consider removing or renaming it as _ (revive)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Summary by CodeRabbit
New Features
Bug Fixes
Documentation