Conversation
… requests objects.
…s ONC modules and update constructor signatures
IanTBlack
reviewed
Apr 23, 2026
| Set up a logger object for displaying verbose messages to console. | ||
|
|
||
| :param logger_name: The unique logger name to use. Can be shared between modules | ||
| :param level: The logging level to use. Default is 2, which corresponds to DEBUG. |
Collaborator
There was a problem hiding this comment.
Doc string should be updated to reflect logging numeric values.
https://docs.python.org/3/library/logging.html#logging-levels
Collaborator
There was a problem hiding this comment.
Nevermind. I see that this is outdated.
Collaborator
|
Received. I won't be able to begin reviewing and testing this for another week or so. |
Collaborator
Author
|
No worries. Take your time. Besides the code review, I think it would be beneficial if you can test it using your actual script to see if any bug or unexpected behavior exists. pip install onc@git+https://github.com/OceanNetworksCanada/api-python-client@issue-68-logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
a folllow-up pr based on #69
The most significant change in this series of commits is the replacement of direct
print()statements andwarnings.warn()calls with a structured, hierarchical logging system.Mapping Logic
The migration follows a consistent mapping from the previous console output to the new logging levels:
print()(Progress/Status)INFOprint()(Debug/Metadata)DEBUGwarnings.warn()WARNINGERRORCustom Formatting
To maintain backwards compatibility with the library's plain console output, a custom
OnclibFormatterwas implemented. It suppresses metadata prefixes (timestamps, logger names, levels) forINFOlevel logs, while preserving full context for other levels.Test Suite
The test suite's error handling was refactored to match the new error report behavior by introducing centralized
err_400anderr_404fixtures intests/conftest.py.Documentation
The final refactoring phase focused on using NumPy docstring style for consistent format