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

Fixes issue with extended backport class for ConsoleRenderer (issue with tomodachi 26.x since structlog 23.3.0) #1868

Merged
merged 9 commits into from
Jan 14, 2024

Conversation

kalaspuff
Copy link
Owner

Backport class only used if environment has an older version of structlog installed.

Uses native ConsoleRenderer class from structlog if using a more modern version of structlog (>= 23.3.0).


This fixes the issue that raises an AttributeError upon starting a service. Noticed when using structlog 23.3.0 or 24.1.0 releases.

File ".../site-packages/tomodachi/logging.py", line 988, in __call__
    _level_to_color = self._level_to_color
                      ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConsoleRenderer' object has no attribute '_level_to_color'

Copy link

codecov bot commented Jan 14, 2024

Codecov Report

Attention: 61 lines in your changes are missing coverage. Please review.

Comparison is base (dfc59fe) 73.70% compared to head (646a9b2) 73.11%.

Files Patch % Lines
tomodachi/logging.py 6.15% 61 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1868      +/-   ##
==========================================
- Coverage   73.70%   73.11%   -0.59%     
==========================================
  Files          52       52              
  Lines        7640     7655      +15     
==========================================
- Hits         5631     5597      -34     
- Misses       2009     2058      +49     

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

@kalaspuff kalaspuff merged commit cd309c7 into master Jan 14, 2024
9 checks passed
@kalaspuff kalaspuff deleted the feature/structlog-fix branch January 14, 2024 22:15
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