Skip to content

Commit fdfab7e

Browse files
goodki-dahopkins
andauthored
FIx handler list mutation while removing handlers (#266)
* fix: remove handler list mutation while removing handlers * clean --------- Co-authored-by: Adam Hopkins <[email protected]>
1 parent 171f9bd commit fdfab7e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sanic_ext/extensions/logging/logger.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ async def setup_server_logging(app: Sanic):
5454

5555
for logger_name in app.config.LOGGERS:
5656
logger_instance = logging.getLogger(logger_name)
57-
for handler in logger_instance.handlers:
58-
logger_instance.removeHandler(handler)
57+
logger_instance.handlers.clear()
5958
logger_instance.addHandler(qhandler)
6059

6160

0 commit comments

Comments
 (0)