diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 5429e90f2..16d398763 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -24,6 +24,7 @@ DEALINGS IN THE SOFTWARE. from __future__ import annotations import inspect +import logging from discord.utils import maybe_coroutine, MISSING from typing import Any, Callable, Dict, Generator, List, Optional, TYPE_CHECKING, Tuple, TypeVar @@ -44,6 +45,8 @@ __all__ = ( FuncT = TypeVar('FuncT', bound=Callable[..., Any]) +_log = logging.getLogger(__name__) + class CogMeta(type): """A metaclass for defining a cog. @@ -508,4 +511,4 @@ class Cog(metaclass=CogMeta): try: await maybe_coroutine(self.cog_unload) except Exception: - pass + _log.exception('Ignoring exception in cog unload for Cog %r (%r)', cls, self.qualified_name)