Release v4.0.7#104
Merged
Merged
Conversation
…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
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.
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:
"WARN"to"WARNING") to ensure compatibility with Python logging conventions (LEVEL_NORMALIZEinwebserver/logger/parser.py).parse_and_loginwebserver/logger/parser.py). [1] [2]Logger configuration and handler updates:
get_loggerby removing unnecessary type checks, ensuring all handlers reflect the current configuration (get_loggerinwebserver/logger/__init__.py).logger/logger.pyfile and migrated logger setup logic towebserver/logger/__init__.py. [1] [2]Testing improvements:
print_debugis enabled, improving coverage and reliability of log level filtering (test_logger_buffer.py).