Skip to content

logger: check isatty stream to print colored logs or not instead of depending on colorama (#8993#8993

Merged
skshetry merged 1 commit into
treeverse:mainfrom
skshetry:logger-color-isatty
Feb 9, 2023
Merged

logger: check isatty stream to print colored logs or not instead of depending on colorama (#8993#8993
skshetry merged 1 commit into
treeverse:mainfrom
skshetry:logger-color-isatty

Conversation

@skshetry
Copy link
Copy Markdown
Collaborator

@skshetry skshetry commented Feb 9, 2023

  • Also adds support for printing stack_info
  • Changed datetime color to be same as log-level color, instead of it always being GREEN.
  • Simplified code
  • Removed line that we used to print as a separation for exception for simplicity. Now, we have similar logic to StreamHandler.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 9, 2023

Codecov Report

Base: 93.11% // Head: 92.74% // Decreases project coverage by -0.38% ⚠️

Coverage data is based on head (d468d56) compared to base (f104367).
Patch coverage: 89.74% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8993      +/-   ##
==========================================
- Coverage   93.11%   92.74%   -0.38%     
==========================================
  Files         455      455              
  Lines       36696    36713      +17     
  Branches     5295     4320     -975     
==========================================
- Hits        34170    34048     -122     
- Misses       2014     2120     +106     
- Partials      512      545      +33     
Impacted Files Coverage Δ
dvc/logger.py 86.42% <89.47%> (-1.38%) ⬇️
tests/unit/test_logger.py 100.00% <100.00%> (ø)
tests/func/test_unprotect.py 78.57% <0.00%> (-21.43%) ⬇️
tests/unit/utils/test_utils.py 83.33% <0.00%> (-16.67%) ⬇️
tests/unit/test_daemon.py 85.18% <0.00%> (-14.82%) ⬇️
dvc/utils/fs.py 83.63% <0.00%> (-10.91%) ⬇️
tests/unit/proc/test_manager.py 89.28% <0.00%> (-10.72%) ⬇️
dvc/proc/manager.py 66.66% <0.00%> (-9.68%) ⬇️
tests/unit/utils/test_fs.py 88.42% <0.00%> (-9.48%) ⬇️
tests/unit/test_analytics.py 92.85% <0.00%> (-7.15%) ⬇️
... and 19 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@skshetry skshetry changed the title logger: check isatty stream to print colored logs or not instead of depending on colorama logger: check isatty stream to print colored logs or not instead of depending on colorama (#8993 Feb 9, 2023
@skshetry skshetry merged commit 5490fc0 into treeverse:main Feb 9, 2023
@skshetry skshetry deleted the logger-color-isatty branch February 9, 2023 08:05
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.

1 participant