-
Notifications
You must be signed in to change notification settings - Fork 37
👻 Small adjustment in logging. #959
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
Conversation
Signed-off-by: Jeff Ortel <[email protected]>
WalkthroughLog enablement checks are refactored from numeric thresholds to verbose logger method calls across two manager files. Additionally, the reaper manager introduces conditional duration logging based on a 10-second execution threshold. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 (1)
reaper/manager.go (1)
54-70: Consider structured logging for better observability.The threshold-based conditional logging successfully reduces log spam as intended. However, the log message on line 69 uses string concatenation rather than structured key-value pairs.
Apply this diff to improve log message structure:
- if d > threshold { - Log.Info("Duration: " + d.String()) - } + if d > threshold { + Log.Info( + "Reaper duration exceeded threshold.", + "duration", + d.String(), + "threshold", + threshold.String()) + }This provides better structured logging and makes it easier to filter/query logs in observability tools.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
reaper/manager.go(3 hunks)task/manager.go(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-28T22:13:58.822Z
Learnt from: jortel
Repo: konveyor/tackle2-hub PR: 897
File: task/collector.go:95-96
Timestamp: 2025-10-28T22:13:58.822Z
Learning: In the konveyor/tackle2-hub codebase, `Log.Error(err, "")` is a no-op when `err == nil`, so there's no need to add explicit `if err != nil` checks before calling `Log.Error`.
Applied to files:
task/manager.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: build
- GitHub Check: test-unit
- GitHub Check: vet
🔇 Additional comments (2)
task/manager.go (1)
138-140: LGTM! Logging behavior improved.The change from a numeric settings check to
Log.V(1).Enabled()correctly gates DB debug logging based on the logger's verbosity level, which is more idiomatic and aligns with structured logging practices.reaper/manager.go (1)
36-38: LGTM! Consistent logging pattern.The change to
Log.V(1).Enabled()matches the approach in task/manager.go and correctly uses the logger's verbosity level instead of a numeric settings check.
Log the db based on Logger level enabled instead of using the Setting directly.
Log the reaper only when it takes a long time. Reduces spam in the logs.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.