Skip to content
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

fix: debug logs causing CLI to quit unexpectedly [CLI-638] #5682

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

j-luong
Copy link
Contributor

@j-luong j-luong commented Jan 23, 2025

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)

What does this PR do?

This PR should set an upper limit on the length of some logs outputted by the debug lib. In particular, log a log that outputs an full api response which can lead to the CLI quitting unexpectedly.

Where should the reviewer start?

How should this be manually tested?

@j-luong j-luong requested a review from a team as a code owner January 23, 2025 11:29
Copy link
Contributor

github-actions bot commented Jan 23, 2025

Warnings
⚠️

You've modified files in src/ directory, but haven't updated anything in test folder. Is there something that could be tested?

Generated by 🚫 dangerJS against 0318b71

@j-luong j-luong force-pushed the fix/CLI-638_truncateLogLine branch from 691796c to a784077 Compare January 23, 2025 11:34
@j-luong j-luong force-pushed the fix/CLI-638_truncateLogLine branch from a784077 to 0318b71 Compare January 23, 2025 11:42

// Upper limit of string length that should be allowed for output to stdrr || stdout.
// Use when outputting strings of unknown length. e.g. response payloads
export const MAX_STRING_LENGTH = 50000;
Copy link
Contributor

Choose a reason for hiding this comment

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

💭 How did we end up at 50,000? Did the logs we have get cut above this value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When looking at CLI logs, the CLI was unexpectedly quitting on debug logs when the character length was ~70-75k. I chose 50k as a "safe" upper limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants