Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions haystack/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ def configure_logging(use_json: bool | None = None) -> None:
# Use OUR `ProcessorFormatter` to format all `logging` entries.
handler.setFormatter(formatter)

root_logger = logging.getLogger()
haystack_logger = logging.getLogger("haystack")
# avoid adding our handler twice
old_handlers = [
h
for h in root_logger.handlers
for h in haystack_logger.handlers
if not (isinstance(h, logging.StreamHandler) and h.name == "HaystackLoggingHandler")
]
new_handlers = [handler, *old_handlers]
root_logger.handlers = new_handlers
haystack_logger.handlers = new_handlers
Loading