Skip to content

Improve Python bskLogging API with convenience methods and level aliases#1409

Open
ReeceHumphreys wants to merge 6 commits into
developfrom
feature/pythonic-logging
Open

Improve Python bskLogging API with convenience methods and level aliases#1409
ReeceHumphreys wants to merge 6 commits into
developfrom
feature/pythonic-logging

Conversation

@ReeceHumphreys

@ReeceHumphreys ReeceHumphreys commented May 31, 2026

Copy link
Copy Markdown
Contributor
  • Review: By commit
  • Merge strategy: Merge (no squash)

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 on BSKLogger which mirror the logging.Logger API.
  • setLevel() as an alias for setLogLevel()
  • A LogLevel IntEnum for typed level references

All 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

  • We could deprecate the existing API.
  • Generally I think we should make sure the API we expose feels very Pythonic and not just like python flavored C++. I am sure there are other spots like this we could improve the feel of the API.

@ReeceHumphreys ReeceHumphreys self-assigned this May 31, 2026
@ReeceHumphreys ReeceHumphreys requested a review from a team as a code owner May 31, 2026 03:54
@ReeceHumphreys ReeceHumphreys added the enhancement New feature or request label May 31, 2026
@ReeceHumphreys ReeceHumphreys moved this to 👀 In review in Basilisk May 31, 2026
@ReeceHumphreys ReeceHumphreys force-pushed the feature/pythonic-logging branch 2 times, most recently from 1547d89 to c1e3272 Compare May 31, 2026 04:50
@ReeceHumphreys ReeceHumphreys force-pushed the feature/pythonic-logging branch from 99b9ca5 to 776c50e Compare May 31, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

1 participant