Skip to content

Release v4.0.7#104

Merged
thiagoralves merged 3 commits into
mainfrom
development
Feb 6, 2026
Merged

Release v4.0.7#104
thiagoralves merged 3 commits into
mainfrom
development

Conversation

@thiagoralves
Copy link
Copy Markdown
Contributor

This pull request introduces improvements to the logging system, focusing on log level handling and normalization, as well as enhancements to the logger configuration and testing. The most notable changes are the normalization of log level names, updates to logger handler configuration, and expanded test coverage for debug log filtering.

Log level normalization and handling:

  • Added normalization for non-standard log level names (e.g., mapping "WARN" to "WARNING") to ensure compatibility with Python logging conventions (LEVEL_NORMALIZE in webserver/logger/parser.py).
  • Updated log parsing logic to apply normalization and ensure the correct log level is used and stored in parsed log entries (parse_and_log in webserver/logger/parser.py). [1] [2]

Logger configuration and handler updates:

  • Simplified handler level updates in get_logger by removing unnecessary type checks, ensuring all handlers reflect the current configuration (get_logger in webserver/logger/__init__.py).
  • Removed the now-redundant logger/logger.py file and migrated logger setup logic to webserver/logger/__init__.py. [1] [2]

Testing improvements:

  • Added tests to verify that debug log messages are filtered out by default and included when print_debug is enabled, improving coverage and reliability of log level filtering (test_logger_buffer.py).

claude and others added 3 commits February 6, 2026 20:38
…sages

BufferHandler extends logging.Handler directly, not logging.StreamHandler.
The isinstance(h, logging.StreamHandler) check skipped it, leaving its
level at NOTSET (0) which passes all messages through. This caused debug
messages (e.g. status query responses from SyncUnixClient) to accumulate
in the buffer and appear in the REST API /api/runtime-logs endpoint even
when --print-debug was not set.

https://claude.ai/code/session_01JAxvToztqockUCUQSC7dv7
Three logging fixes:

1. LogParser now maps C runtime's "WARN" to Python's "WARNING" for both
   the numeric level (used by handler filtering) and the string stored
   in log entries. Previously WARN messages got level=INFO (wrong
   numeric mapping) and were stored as "WARN" in the buffer while
   Python-originated warnings stored "WARNING", breaking level filtering
   in the REST API.

2. Remove dead webserver/logger/logger.py which defined a shadowed
   get_logger() that created separate BufferHandlers without level
   filtering. The __init__.py import that pulled it in was also removed.

3. Update test_log_levels_stored to verify debug messages are filtered
   by default, and add test_log_levels_stored_with_print_debug to
   verify they pass through when print_debug is enabled.

https://claude.ai/code/session_01JAxvToztqockUCUQSC7dv7
…suppression-znOmO

fix: Apply log level filtering to BufferHandler to suppress debug messages
@thiagoralves thiagoralves merged commit 626cd49 into main Feb 6, 2026
0 of 2 checks passed
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.

2 participants