Skip to content

Conversation

@LaurenceJJones
Copy link
Member

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.

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.
@github-actions
Copy link

@LaurenceJJones: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I 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.

@github-actions
Copy link

@LaurenceJJones: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I 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)
Copy link
Member Author

@LaurenceJJones LaurenceJJones Dec 12, 2025

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) {
Copy link
Member Author

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

Copy link
Contributor

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

Copy link
Member Author

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)
Copy link
Member Author

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

@LaurenceJJones
Copy link
Member Author

/kind refactoring
/area local-api

@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.91%. Comparing base (874cf66) to head (c190322).
⚠️ Report is 5 commits behind head on master.

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     
Flag Coverage Δ
bats 46.14% <50.00%> (-0.07%) ⬇️
unit-linux 35.76% <100.00%> (+0.15%) ⬆️
unit-windows 25.04% <75.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants