-
Notifications
You must be signed in to change notification settings - Fork 556
refactor(apic): reduce LAPI client debug log verbosity #4136
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
base: master
Are you sure you want to change the base?
refactor(apic): reduce LAPI client debug log verbosity #4136
Conversation
Move verbose debug logs to trace level: - Headers loop and full response dumps in client_http.go - Token expiration and scenario update messages in auth_jwt.go - Error response status messages in auth_jwt.go Keep essential debug info (request URLs, response codes) visible. Standardize response code format to 'http %d' for consistency.
|
@LaurenceJJones: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
@LaurenceJJones: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
|
||
| if resp.StatusCode < 200 || resp.StatusCode >= 300 { | ||
| log.Debugf("received response status %q when fetching %v", resp.Status, req.URL) | ||
| log.Tracef("received response status %q when fetching %v", resp.Status, req.URL) |
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.
might be useful at debug level 🤷🏻 but we already log the status anyways and URL so this could be removed?
| } | ||
|
|
||
| log.Debugf("token %s will expire on %s", t.Token, t.Expiration.String()) | ||
| if log.IsLevelEnabled(log.TraceLevel) { |
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.
wrapped because t....String() causes allocation
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.
That's what %v is for
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.
but %v doesnt log as human readable no?
|
|
||
| if resp != nil { | ||
| log.Debugf("resp-jwt: %d", resp.StatusCode) | ||
| log.Debugf("resp-jwt: http %d", resp.StatusCode) |
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.
Updated to be consistent with resp-api: http 200 example
|
/kind refactoring |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4136 +/- ##
==========================================
+ Coverage 62.86% 62.91% +0.05%
==========================================
Files 464 464
Lines 33290 33349 +59
==========================================
+ Hits 20927 20983 +56
Misses 10241 10241
- Partials 2122 2125 +3
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:
|
Move verbose debug logs to trace level:
Keep essential debug info (request URLs, response codes) visible. Standardize response code format to 'http %d' for consistency.