Repository navigation
Remove unreachable emoji entries and add use_emoji - #51
Merged
Merged
Conversation
## Summary `ContextFilter` mapped six levels (`SYSTEM`, `SECURITY`, `NETWORK`, `DATABASE`, `STARTUP`, `SHUTDOWN`) to emoji although those levels are never registered, so the entries were dead code. Emoji also could not be turned off. ## Changes - Remove the unreachable entries and move the map to a module constant, `_LEVEL_EMOJI`, which matches the five standard levels. Registering custom levels would add API surface nobody asked for, so removal is the simpler option from the issue. - Add `setup_logging(use_emoji=True)`. Setting it to `False` leaves the emoji out of the verbose console layout. - The emoji field now carries its own leading space, so levels without an emoji, and `use_emoji=False`, no longer leave a stray space inside the brackets. - README options table and changelog updated, with tests for the map, the default, the switch and custom levels. ## Verification - `pytest`: 105 passed (latest dependencies) and 87 passed with 18 skipped (no extras). `ruff` and `mypy --strict` are clean. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U2nYHVGDdthQpcwNBPbp8r
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.
Summary
ContextFiltermapped six levels (SYSTEM,SECURITY,NETWORK,DATABASE,STARTUP,SHUTDOWN) to emoji although those levels are never registered, so the entries were dead code. Emoji also could not be turned off.Changes
_LEVEL_EMOJI, which matches the five standard levels. Registering custom levels would add API surface nobody asked for, so removal is the simpler option from the issue.setup_logging(use_emoji=True). Setting it toFalseleaves the emoji out of the verbose console layout.use_emoji=False, no longer leave a stray space inside the brackets.Verification
pytest: 105 passed (latest dependencies) and 87 passed with 18 skipped (no extras).ruffandmypy --strictare clean.Closes #25
🤖 Generated with Claude Code
https://claude.ai/code/session_01U2nYHVGDdthQpcwNBPbp8r
Generated by Claude Code