Skip to content

Reduce verbose debug log contents#2134

Merged
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main
Sep 3, 2025
Merged

Reduce verbose debug log contents#2134
cb-github-robot merged 1 commit intocloud-barista:mainfrom
seokho-son:main

Conversation

@seokho-son
Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Seokho Son <shsongist@gmail.com>
Copilot AI review requested due to automatic review settings September 3, 2025 06:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reduces verbose debug logging throughout the application to improve log readability and performance by commenting out detailed debug statements and adjusting log levels.

  • Commented out detailed debug logs in spec filtering and processing operations
  • Changed an info-level log to debug level in recommendation ordering
  • Updated distance band thresholds in location-based ordering logic
  • Fixed Go style issues and increased debug body length limit

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/core/resource/spec.go Commented out verbose debug logs during spec filtering and processing, added TODO comment
src/core/infra/recommendation.go Changed order-by log from info to debug level, updated distance band thresholds
src/core/common/utility.go Removed unused variable in range loop
src/core/common/client/client.go Increased debug body length limit and improved truncation message

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Int("ignoredSpecs", ignoredCount).
Int("processedSpecs", int(specCount)).
Msgf("Spec processing completed: %d/%d specs processed (%d ignored)",
Msgf("Spec processing completed: %d/%d (%d ignored)",
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The log message format is inconsistent with the previous pattern. Consider keeping the 'specs processed' terminology for clarity: Msgf(\"Spec processing completed: %d/%d specs processed (%d ignored)\",

Suggested change
Msgf("Spec processing completed: %d/%d (%d ignored)",
Msgf("Spec processing completed: %d/%d specs processed (%d ignored)",

Copilot uses AI. Check for mistakes.
Comment on lines +69 to +74
// Fast integer approximation: ~7 bytes per word in JSON
bodyWords := bodyLength / 7
limitWords := MaxDebugBodyLength / 7

return fmt.Sprintf(`{"message":"Response body %d words (%d bytes) exceeds limit %d words (%d bytes). Use TRACE level to log and check content."}`,
bodyWords, bodyLength, limitWords, MaxDebugBodyLength)
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The word count calculation using integer division by 7 is an approximation that may be confusing. Consider adding a comment explaining this is an estimate, or use a more descriptive variable name like estimatedWords.

Suggested change
// Fast integer approximation: ~7 bytes per word in JSON
bodyWords := bodyLength / 7
limitWords := MaxDebugBodyLength / 7
return fmt.Sprintf(`{"message":"Response body %d words (%d bytes) exceeds limit %d words (%d bytes). Use TRACE level to log and check content."}`,
bodyWords, bodyLength, limitWords, MaxDebugBodyLength)
// Fast integer approximation: ~7 bytes per word in JSON; this is an estimate, not an exact word count
estimatedWords := bodyLength / 7
estimatedLimitWords := MaxDebugBodyLength / 7
return fmt.Sprintf(`{"message":"Response body estimated at %d words (%d bytes) exceeds limit of %d words (%d bytes). Use TRACE level to log and check content."}`,
estimatedWords, bodyLength, estimatedLimitWords, MaxDebugBodyLength)

Copilot uses AI. Check for mistakes.
@seokho-son
Copy link
Copy Markdown
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Sep 3, 2025
@cb-github-robot cb-github-robot merged commit d430e3e into cloud-barista:main Sep 3, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This PR is approved and will be merged soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants