diff --git a/plugin.py b/plugin.py index e2fbe54..915e50b 100644 --- a/plugin.py +++ b/plugin.py @@ -28,6 +28,7 @@ package_logger.propagate = False logger = logging.getLogger(__name__) TEXT_LISTENER = None +rt.dispatch(inner_logger.listen(), "codemp-logger") # Initialisation and Deinitialisation @@ -38,8 +39,6 @@ def plugin_loaded(): # instantiate and start a global asyncio event loop. # pass in the exit_handler coroutine that will be called upon relasing the event loop. # tm.acquire(disconnect_client) - rt.start() - rt.dispatch(inner_logger.listen(), "codemp-logger") TEXT_LISTENER = CodempClientTextChangeListener() diff --git a/src/logger.py b/src/logger.py index 45a05e5..d4cc6e5 100644 --- a/src/logger.py +++ b/src/logger.py @@ -2,12 +2,13 @@ import logging from asyncio import CancelledError from codemp import PyLogger +logger = logging.getLogger(__name__) + class CodempLogger: def __init__(self, log_level): - self.logger = logging.getLogger(__name__) + self.logger = logger self.level = log_level - self.logger.setLevel(self.level) self.internal_logger = None self.started = False