mirror of
https://github.com/hexedtech/codemp-sublime.git
synced 2024-12-24 05:24:54 +01:00
feat: dispatch now runs on our custom loop
and can be started outside of `plugin_loaded()` Former-commit-id: 9c8c99ed5704b4b18312e73b9b31c192805ad524
This commit is contained in:
parent
1b9809e167
commit
974afb98f1
2 changed files with 4 additions and 4 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue