From 5abfb63bd31ec8e8eaaaeffb9244762472aed878 Mon Sep 17 00:00:00 2001 From: alemidev Date: Sun, 3 Jul 2022 01:15:50 +0200 Subject: [PATCH] feat: log module cleanup in debug --- src/treepuncher/treepuncher.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/treepuncher/treepuncher.py b/src/treepuncher/treepuncher.py index f157b17..f6e85a2 100644 --- a/src/treepuncher/treepuncher.py +++ b/src/treepuncher/treepuncher.py @@ -20,6 +20,10 @@ from .notifier import Notifier, Provider __VERSION__ = pkg_resources.get_distribution('treepuncher').version +async def _cleanup(m: Addon, l: logging.Logger): + await m.cleanup() + l.debug("Cleaned up addon %s", m.name) + class MissingParameterError(Exception): pass @@ -161,7 +165,7 @@ class Treepuncher( await self.join_callbacks() self.logger.debug("Joined callbacks") await asyncio.gather( - *(m.cleanup() for m in self.modules) + *(_cleanup(m, self.logger) for m in self.modules) ) self.logger.debug("Cleaned up addons") await super().stop()