Skip to content

Add consistent snake_case/camelCase aliases for is_enabled_for & getEffectiveLevel#797

Open
r266-tech wants to merge 1 commit intohynek:mainfrom
r266-tech:fix-consistent-is-enabled-for
Open

Add consistent snake_case/camelCase aliases for is_enabled_for & getEffectiveLevel#797
r266-tech wants to merge 1 commit intohynek:mainfrom
r266-tech:fix-consistent-is-enabled-for

Conversation

@r266-tech
Copy link

Fixes #779

Problem

and have inconsistent method naming:

  • only has / (snake_case)
  • only has / (camelCase)

This causes when the same code path can hit both classes depending on configuration.

Solution

Add aliases so both classes support both naming conventions:

  1. ****: Added and aliases to dynamically-created classes
  2. ****: Added and aliases to
  3. ****: Added both methods to the protocol

Testing

Verified both naming conventions work and return identical values on both and .

…ffectiveLevel

Fixes hynek#779: BoundLogger and BoundLoggerFilteringAtNotset now both support
both / and /.

Previously:
- BoundLoggerFilteringAtNotset only had snake_case (is_enabled_for, get_effective_level)
- BoundLogger only had camelCase (isEnabledFor, getEffectiveLevel)

This caused AttributeError when the same code path hit both classes.
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.

Make consistent attribute access for is_enabled_for / isEnabledFor

1 participant