| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
… requests objects.
…s ONC modules and update constructor signatures
| 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. |
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
Sorry, something went wrong.
There was a problem hiding this comment.
Nevermind. I see that this is outdated.
Sorry, something went wrong.
|
Received. I won't be able to begin reviewing and testing this for another week or so. |
Sorry, something went wrong.
|
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 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
a folllow-up pr based on #69
The most significant change in this series of commits is the replacement of direct print() statements and warnings.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:
Custom Formatting
To maintain backwards compatibility with the library's plain console output, a custom OnclibFormatter was implemented. It suppresses metadata prefixes (timestamps, logger names, levels) for INFO level 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_400 and err_404 fixtures in tests/conftest.py.
Documentation
The final refactoring phase focused on using NumPy docstring style for consistent format