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

Don't write colors and logs on disk if not necessary #4934

Merged
merged 6 commits into from
Dec 5, 2023

Conversation

ferrarimarco
Copy link
Collaborator

@ferrarimarco ferrarimarco commented Dec 4, 2023

Proposed Changes

  1. Don't write logs on disk if the CREATE_LOG_FILE is not set to true. This resulted in about 50% increase in performance in our CI builds. For example, compare the results of this build against this.
  2. Don't write ANSI color markers in the log file. This makes the log file more readable.
  3. Move the log file from the temporary directory to the final location instead of using cat to copy data.
  4. Reduce some code duplication by defining the log format once.

Example log line in the log file before this change:

�[0m2023-12-04 10:06:17 �[0;34m[INFO]�[0m   Linting [JSCPD] files...�[0m

After:

2023-12-04 14:20:46 [INFO]   Linting [JSCPD] files...

Readiness Checklist

Author/Contributor

  • I included all the needed documentation for this change.
  • I provided the necessary tests.

Reviewing Maintainer

  • Label as breaking if this is a large, fundamental change.
  • Label as either: automation, bug, documentation, enhancement, infrastructure.

BEGIN_COMMIT_OVERRIDE
feat: don't write colors and logs on disk if not necessary (#4934)
END_COMMIT_OVERRIDE

@ferrarimarco ferrarimarco marked this pull request as draft December 4, 2023 13:07
@ferrarimarco ferrarimarco marked this pull request as ready for review December 4, 2023 14:48
Copy link
Contributor

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

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

🚀 🚀

@ferrarimarco ferrarimarco added this pull request to the merge queue Dec 5, 2023
Merged via the queue into main with commit 879672e Dec 5, 2023
3 checks passed
@ferrarimarco ferrarimarco deleted the fix-color-logging branch December 5, 2023 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants