-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
feat(logging): Allow configuring logging verbosity level #872
Conversation
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.
Given that you've never written Go before, you're doing excellent work!
FYI, don't hesitate to let me know if you want me to add something else to the logr library. |
Hi. All good suggestions, the changes to logr make it a easier to integrate 👍 As far as suggestions, I can imagine convenience methods such as |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #872 +/- ##
==========================================
- Coverage 77.59% 77.53% -0.06%
==========================================
Files 72 72
Lines 5775 5779 +4
==========================================
Hits 4481 4481
- Misses 1078 1082 +4
Partials 216 216 ☔ View full report in Codecov by Sentry. |
watchdog/watchdog.go
Outdated
|
||
logr.Debugf("[watchdog.execute] Monitoring group=%s; endpoint=%s", ep.Group, ep.Name) | ||
|
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.
logr.Debugf("[watchdog.execute] Monitoring group=%s; endpoint=%s", ep.Group, ep.Name) | |
logr.Debugf("[watchdog.execute] Monitoring group=%s; endpoint=%s", ep.Group, ep.Name) |
main.go
Outdated
@@ -23,6 +25,8 @@ func main() { | |||
if err != nil { | |||
panic(err) | |||
} | |||
|
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.
Hi - requested changes have been pushed. |
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.
Thank you for the contribution!
@garyhodgson FYI I decided to move log-level to an environment variable - see #895 |
Summary
Introduces logr library as per #871
I'm not a Go Developer, so apologies if the attempt isn't very go-ish.
I couldn't see a way to use enums for mapping the log level names to logr.Level ints, so I made use of this library: https://hermannm.dev/enumnames
I performed a few manual tests, not sure how unit tests of log output would work.
Checklist
README.md
, if applicable.