Skip to content

feat: support base logger configuration - #596

Merged
nfelt14 merged 5 commits into
tektronix:mainfrom
sanmaxdev:feat/base-logger-config
Jul 8, 2026
Merged

nfelt14 merged 5 commits into
tektronix:mainfrom
sanmaxdev:feat/base-logger-config

Conversation

@sanmaxdev

Copy link
Copy Markdown
Contributor

Proposed changes

Adds a logger parameter to configure_logging() so callers can derive the tm_devices logger from an existing application logger instead of always starting from the package logger name.

Addresses #589

Types of changes

  • 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

  • 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

Testing

  • python -m pytest tests/test_logging.py -q
  • python -m compileall src/tm_devices/helpers/logging.py
  • ruff check src/tm_devices/helpers/logging.py tests/test_logging.py
  • git diff --check

@sanmaxdev
sanmaxdev requested review from a team as code owners June 25, 2026 05:41
Comment thread CHANGELOG.md Resolved
@sanmaxdev

Copy link
Copy Markdown
Contributor Author

Moved the changelog entry under a new ### Added section as requested.

Verification:

  • git diff --check
  • SKIP=pyroma,poetry-lock,poetry-audit pre-commit run --files CHANGELOG.md

nfelt14
nfelt14 previously approved these changes Jun 26, 2026
Comment thread src/tm_devices/helpers/logging.py Fixed
nfelt14
nfelt14 previously approved these changes Jun 26, 2026
@nfelt14

nfelt14 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

According to the contribution guidelines, you need to make sure your commits are signed

Comment thread src/tm_devices/helpers/logging.py Dismissed
@sanmaxdev
sanmaxdev force-pushed the feat/base-logger-config branch from 85b6fb2 to fb346a3 Compare June 26, 2026 19:48
@sanmaxdev

Copy link
Copy Markdown
Contributor Author

Thanks, I rewrote the branch so all commits are signed now.

@sanmaxdev

Copy link
Copy Markdown
Contributor Author

Pushed a small follow-up for the pylint failure. The logging format strings now live at module scope, which keeps configure_logging() under the local-variable limit without changing behavior.

Verified with:

  • python -m compileall src/tm_devices/helpers/logging.py tests/test_logging.py
  • PYTHONPATH=$PWD/src python -m pytest tests/test_logging.py -q
  • ruff check src/tm_devices/helpers/logging.py tests/test_logging.py
  • python -m pylint src/tm_devices/helpers/logging.py --disable=all --enable=too-many-locals
  • git diff --check

nfelt14
nfelt14 previously approved these changes Jun 29, 2026
@codecov

codecov Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a8b929c) to head (70e2694).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #596   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          166       166           
  Lines         4864      4866    +2     
  Branches       437       437           
=========================================
+ Hits          4864      4866    +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Test Results (macos)

path passed subtotal
tests/test_abstract_device_expect_esr.py 1 1
tests/test_afgs.py 2 2
tests/test_alias_dict.py 1 1
tests/test_all_device_drivers.py 112 112
tests/test_alternative_connection_addresses.py 19 19
tests/test_awgs.py 4 4
tests/test_config_parser.py 50 50
tests/test_device_manager.py 18 18
tests/test_devices_legacy_tsp_ieee_cmds.py 3 3
tests/test_extension_mixin.py 1 1
tests/test_generate_waveform.py 6 6
tests/test_helpers.py 94 94
tests/test_ieee_scpi_cmds.py 1 1
tests/test_logging.py 5 5
tests/test_mainframe.py 13 13
tests/test_margin_testers.py 5 5
tests/test_pi_device.py 1 1
tests/test_psu.py 1 1
tests/test_rest_api_device.py 10 10
tests/test_schema.py 7 7
tests/test_scopes.py 10 10
tests/test_singleton.py 1 1
tests/test_smu.py 4 4
tests/test_ss.py 1 1
tests/test_tm_devices.py 471 471
tests/test_unsupported_device_type.py 1 1
tests/test_verification_functions.py 13 13
TOTAL 855 855

Link to workflow run

@github-actions

github-actions Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Test Results (ubuntu)

path passed subtotal
tests/test_abstract_device_expect_esr.py 1 1
tests/test_afgs.py 2 2
tests/test_alias_dict.py 1 1
tests/test_all_device_drivers.py 112 112
tests/test_alternative_connection_addresses.py 19 19
tests/test_awgs.py 4 4
tests/test_config_parser.py 50 50
tests/test_device_manager.py 18 18
tests/test_devices_legacy_tsp_ieee_cmds.py 3 3
tests/test_extension_mixin.py 1 1
tests/test_generate_waveform.py 6 6
tests/test_helpers.py 94 94
tests/test_ieee_scpi_cmds.py 1 1
tests/test_logging.py 5 5
tests/test_mainframe.py 13 13
tests/test_margin_testers.py 5 5
tests/test_pi_device.py 1 1
tests/test_psu.py 1 1
tests/test_rest_api_device.py 10 10
tests/test_schema.py 7 7
tests/test_scopes.py 10 10
tests/test_singleton.py 1 1
tests/test_smu.py 4 4
tests/test_ss.py 1 1
tests/test_tm_devices.py 471 471
tests/test_unsupported_device_type.py 1 1
tests/test_verification_functions.py 13 13
TOTAL 855 855

Link to workflow run

@github-actions

github-actions Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Test Results (windows)

path passed subtotal
tests\test_abstract_device_expect_esr.py 1 1
tests\test_afgs.py 2 2
tests\test_alias_dict.py 1 1
tests\test_all_device_drivers.py 112 112
tests\test_alternative_connection_addresses.py 19 19
tests\test_awgs.py 4 4
tests\test_config_parser.py 50 50
tests\test_device_manager.py 18 18
tests\test_devices_legacy_tsp_ieee_cmds.py 3 3
tests\test_extension_mixin.py 1 1
tests\test_generate_waveform.py 6 6
tests\test_helpers.py 94 94
tests\test_ieee_scpi_cmds.py 1 1
tests\test_logging.py 5 5
tests\test_mainframe.py 13 13
tests\test_margin_testers.py 5 5
tests\test_pi_device.py 1 1
tests\test_psu.py 1 1
tests\test_rest_api_device.py 10 10
tests\test_schema.py 7 7
tests\test_scopes.py 10 10
tests\test_singleton.py 1 1
tests\test_smu.py 4 4
tests\test_ss.py 1 1
tests\test_tm_devices.py 471 471
tests\test_unsupported_device_type.py 1 1
tests\test_verification_functions.py 13 13
TOTAL 855 855

Link to workflow run

@nfelt14
nfelt14 merged commit 3661337 into tektronix:main Jul 8, 2026
64 checks passed
@sanmaxdev
sanmaxdev deleted the feat/base-logger-config branch July 9, 2026 18:21

This branch was previously deployed

1 inactive deployment
package-build — 70e26946 Deployed Jul 8, 2026 by sanmaxdev via package-build / Build package #1854
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.

3 participants