-
Notifications
You must be signed in to change notification settings - Fork 558
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,7 @@ func (t *JWTTransport) refreshJwtToken(ctx context.Context) error { | |
| return fmt.Errorf("can't update scenario list: %w", err) | ||
| } | ||
|
|
||
| log.Debugf("scenarios list updated for '%s'", *t.MachineID) | ||
| log.Tracef("scenarios list updated for '%s'", *t.MachineID) | ||
| } | ||
|
|
||
| auth := models.WatcherAuthRequest{ | ||
|
|
@@ -117,7 +117,7 @@ func (t *JWTTransport) refreshJwtToken(ctx context.Context) error { | |
| defer resp.Body.Close() | ||
|
|
||
| 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) | ||
|
|
||
| err = CheckResponse(resp) | ||
| if err != nil { | ||
|
|
@@ -144,7 +144,9 @@ func (t *JWTTransport) refreshJwtToken(ctx context.Context) error { | |
| } | ||
| } | ||
|
|
||
| log.Debugf("token %s will expire on %s", t.Token, t.Expiration.String()) | ||
| if log.IsLevelEnabled(log.TraceLevel) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrapped because t....String() causes allocation
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's what %v is for
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but |
||
| log.Tracef("token %s will expire on %s", t.Token, t.Expiration.String()) | ||
| } | ||
|
|
||
| select { | ||
| case t.TokenRefreshChan <- struct{}{}: | ||
|
|
@@ -211,7 +213,7 @@ func (t *JWTTransport) RoundTrip(req *http.Request) (*http.Response, error) { | |
| } | ||
|
|
||
| if resp != nil { | ||
| log.Debugf("resp-jwt: %d", resp.StatusCode) | ||
| log.Debugf("resp-jwt: http %d", resp.StatusCode) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to be consistent with |
||
| } | ||
|
|
||
| config, shouldRetry := t.RetryConfig.StatusCodeConfig[resp.StatusCode] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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?