feat: log module cleanup in debug
This commit is contained in:
parent
0540011bb6
commit
5abfb63bd3
1 changed files with 5 additions and 1 deletions
|
@ -20,6 +20,10 @@ from .notifier import Notifier, Provider
|
||||||
|
|
||||||
__VERSION__ = pkg_resources.get_distribution('treepuncher').version
|
__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):
|
class MissingParameterError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -161,7 +165,7 @@ class Treepuncher(
|
||||||
await self.join_callbacks()
|
await self.join_callbacks()
|
||||||
self.logger.debug("Joined callbacks")
|
self.logger.debug("Joined callbacks")
|
||||||
await asyncio.gather(
|
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")
|
self.logger.debug("Cleaned up addons")
|
||||||
await super().stop()
|
await super().stop()
|
||||||
|
|
Loading…
Reference in a new issue