Merge pull request 'clan-app: Maybe fix the logging errror ValueError: I/O operation on closed file.' (#4974) from Qubasa/clan-core:fix_logging into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4974
This commit is contained in:
Luis Hebendanz
2025-08-26 11:32:48 +00:00

View File

@@ -94,10 +94,10 @@ class LoggingMiddleware(Middleware):
if self.handler:
self.handler.root_logger.removeHandler(self.handler.new_handler)
self.handler.new_handler.close()
if self.log_f:
self.log_f.close()
if self.original_ctx:
set_async_ctx(self.original_ctx)
if self.log_f:
self.log_f.close()
# Register the logging context manager
self.register_context_manager(context, LoggingContextManager(log_file))