events: fix log_capture (#9075)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2024-03-29 14:44:14 +01:00
committed by GitHub
parent b11f12b1db
commit afdff95453

View File

@ -68,7 +68,8 @@ def capture_logs(log_default_output=True) -> Generator[list[LogEvent], None, Non
old_processors = processors.copy()
try:
# clear processors list and use LogCapture for testing
processors.remove(ProcessorFormatter.wrap_for_formatter)
if ProcessorFormatter.wrap_for_formatter in processors:
processors.remove(ProcessorFormatter.wrap_for_formatter)
processors.append(cap)
configure(processors=processors)
yield logs