Skip to content

Remove unreachable emoji entries and add use_emoji - #51

Merged
markbac merged 1 commit into
mainfrom
fix/25-emoji-map
Oct 3, 2026
Merged

markbac merged 1 commit into
mainfrom
fix/25-emoji-map

Conversation

@markbac

@markbac markbac commented Oct 3, 2026

Copy link
Copy Markdown
Owner

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.

Closes #25

🤖 Generated with Claude Code

https://claude.ai/code/session_01U2nYHVGDdthQpcwNBPbp8r


Generated by Claude Code

## 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
@markbac
markbac merged commit 3bc58ba into main Oct 3, 2026
9 checks passed
@markbac
markbac deleted the fix/25-emoji-map branch October 19, 2026 08:53
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.

Emoji map references levels that do not exist (SYSTEM, SECURITY, NETWORK, ...)

2 participants