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

Implement a custom DKISTLogger #317

Merged
merged 4 commits into from Jan 23, 2024
Merged

Implement a custom DKISTLogger #317

merged 4 commits into from Jan 23, 2024

Conversation

Cadair
Copy link
Member

@Cadair Cadair commented Jan 23, 2024

This is inspired by Astropy's logger, but implemented independently because Astropy warn you against directly using theirs.

This module sets up the following things:

  • A logging.Logger subclass which:
    • Tracks the module which triggered the log call.
    • Overrides warnings.showwarnings so that subclasses of given warning classes are displayed using the logger.
  • Sets up a log instance which uses the Astropy StreamHandler class to log to stdout and colour the output.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

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

Comparison is base (9e21599) 97.68% compared to head (197e829) 97.64%.

Files Patch % Lines
dkist/logger.py 96.22% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #317      +/-   ##
==========================================
- Coverage   97.68%   97.64%   -0.05%     
==========================================
  Files          32       33       +1     
  Lines        1854     1907      +53     
==========================================
+ Hits         1811     1862      +51     
- Misses         43       45       +2     

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

@Cadair Cadair merged commit a66c7d0 into DKISTDC:main Jan 23, 2024
11 of 15 checks passed
@Cadair Cadair deleted the logger branch January 23, 2024 16:37
Cadair added a commit to Cadair/dkist that referenced this pull request Jan 23, 2024
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.

None yet

1 participant