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

Switch from print to logging #46

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

nfelt14
Copy link
Collaborator

@nfelt14 nfelt14 commented Nov 12, 2024

Proposed changes

This switches TekHSI to use logging instead of normal printing. A new function, configure_logging() is provided so that users can configure what is being logged where. The default behavior keeps the stdout output very similar and adds a file log that contains all logging output.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Functionality update (non-breaking change which updates or changes existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • CI/CD update (an update to the CI/CD workflows, scripts, and/or configurations)
  • Documentation update (an update to enhance the user experience when reading through the docs)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have followed the guidelines in the CONTRIBUTING document
  • I have signed the CLA
  • I have checked to ensure there aren't other open Pull Requests for the same update/change
  • I have created (or updated) an Issue to track the status of this update/change and updated the link in this PR description (see above in the Proposed changes section) using the wording Addresses #<issue_number>
  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • Basic linting passes locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added necessary documentation (if appropriate)
  • I have updated the Changelog with a brief description of my changes

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 96.29630% with 4 lines in your changes missing coverage. Please review.

Project coverage is 80.72%. Comparing base (a0694c8) to head (d4c250c).

Files with missing lines Patch % Lines
src/tekhsi/tek_hsi_connect.py 92.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
+ Coverage   77.66%   80.72%   +3.06%     
==========================================
  Files           3        3              
  Lines         488      524      +36     
  Branches      106       94      -12     
==========================================
+ Hits          379      423      +44     
+ Misses         89       82       -7     
+ Partials       20       19       -1     

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

src/tekhsi/helpers/logging.py Dismissed Show dismissed Hide dismissed
tests/test_logging.py Dismissed Show dismissed Hide dismissed
Copy link

github-actions bot commented Nov 12, 2024

Breaking API Changes

src/tekhsi/helpers/__init__.py:0: print_with_timestamp:
Public object was removed

src/tekhsi/helpers/functions.py:0: <module>:
Public object was removed

Link to workflow run

@nfelt14 nfelt14 enabled auto-merge (squash) November 12, 2024 19:46
Copy link

github-actions bot commented Nov 12, 2024

Test Results (ubuntu)

path passed subtotal
tests/test_client.py 62 62
tests/test_logging.py 3 3
TOTAL 65 65

Link to workflow run

Copy link

github-actions bot commented Nov 12, 2024

Test Results (macos)

path passed subtotal
tests/test_client.py 62 62
tests/test_logging.py 3 3
TOTAL 65 65

Link to workflow run

Copy link

github-actions bot commented Nov 12, 2024

Test Results (windows)

path passed subtotal
tests\test_client.py 62 62
tests\test_logging.py 3 3
TOTAL 65 65

Link to workflow run

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