Skip to content

Fix log filtering#11

Merged
fcogidi merged 1 commit into
mainfrom
fco/fix_log_filtering
Jul 16, 2025
Merged

Fix log filtering#11
fcogidi merged 1 commit into
mainfrom
fco/fix_log_filtering

Conversation

@fcogidi
Copy link
Copy Markdown
Collaborator

@fcogidi fcogidi commented Jul 16, 2025

PR Type

Fix

Short Description

Make sure a handler exists so that the log filtering function can be added to the handler.

Tests Added

N/A

@fcogidi fcogidi requested a review from Copilot July 16, 2025 17:43
@fcogidi fcogidi self-assigned this Jul 16, 2025
@fcogidi fcogidi added the bug Something isn't working label Jul 16, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the log filtering functionality by ensuring that a logging handler exists before attempting to add a filter to it. The fix prevents potential errors when trying to apply the IgnoreOpenAI401Filter to an empty handler list.

  • Adds a check for existing handlers before applying the filter
  • Initializes basic logging configuration if no handlers are present
Comments suppressed due to low confidence (1)

src/utils/logging.py:29

  • The new handler existence check and basicConfig initialization should be covered by tests to ensure the fix works correctly in scenarios where no handlers are initially present.
    if not root_logger.handlers:

@fcogidi fcogidi requested a review from aishwaryapb July 16, 2025 17:46
@fcogidi fcogidi merged commit 7b50b95 into main Jul 16, 2025
4 checks passed
@fcogidi fcogidi deleted the fco/fix_log_filtering branch July 16, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants