Skip to content

Commit 2cfff70

Browse files
committed
Adding an note why we cleanup the logger
1 parent 2a3cf83 commit 2cfff70

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

annotated_logger/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,8 @@ def wrap_function(*args: P.args, **kwargs: P.kwargs) -> R:
788788
_attempt_post_call(post_call, logger, *new_args, **new_kwargs) # pyright: ignore[reportCallIssue]
789789
raise
790790
finally:
791+
# Remove the logger now that we are done with it,
792+
# otherwise they build up and eat memory
791793
logging.root.manager.loggerDict.pop(logger.logger.name, None)
792794
return result
793795

0 commit comments

Comments
 (0)