Improve Python bskLogging API with convenience methods and level aliases#1409
Merged
Conversation
99b9ca5 to
776c50e
Compare
776c50e to
1ec1136
Compare
Contributor
|
The user-facing docs still teach the old API in places touched by this goal. docs/source/Learn/makingModules/numbaModules.rst (line 220) still recommends bskLogger.bskLog(bskLogging.BSK_INFORMATION, ...), and docs/source/Learn/bskPrinciples/bskPrinciples-10.rst (line 15) still demonstrates BSKLogger().bskLog(BSK_ERROR, ...). Since the PR goal is to make BSK Python scripts/docs use the updated API, these should move to info()/warning()/error() and short level names where appropriate. |
1ec1136 to
2f89b1a
Compare
schaubh
approved these changes
Jun 24, 2026
3db448f to
3885d38
Compare
[#1406] [SQUASH] Fix CI failure
With a numba module calling BSKLogger.error() will print the error message, but it does not cause the execution to halt.
Replace hard-coded Numba logger level integers with the bskLogging level aliases used by the rest of the Python logging API. This keeps BskLoggerProxy.debug/info/warning/error and tag selection tied to the public logging names instead of relying on raw numeric enum values.
3885d38 to
3fc55b7
Compare
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.
Description
The bskLogger Python API doesn't match the conventions of Python's standard logging module. This is just a consequence of the SWIG code generation used to expose the C++ class. This PR adds purely additive aliases and convenience methods so users can interact with bskLogger in a more natural and Pythonic way:
debug(),info(),warning(),error()convenience methods onBSKLoggerwhich mirror thelogging.LoggerAPI.setLevel()as an alias forsetLogLevel()LogLevelIntEnum for typed level referencesAll existing APIs remain unchanged so this is fully backward compatible.
Also some minor formatting fixes were applied to the files that were updated. Generally I think when updating these older files its okay to allow the formatter to make some cleanup as long as we don't go overboard and muddle the diff with 1000s of LOC changes.
Verification
Tests passing
Documentation
Updated the bskLogging related documentation.
Future work