fixed internal logger dumplicated output (#299)

* fixed internal logger dumplicated output

* delete unused import

* fixed isort
This commit is contained in:
kaiqli 2021-03-22 14:42:19 +08:00 коммит произвёл GitHub
Родитель 2887bb0482
Коммит ed0ff75c65
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 9 удалений

Просмотреть файл

@ -2,19 +2,12 @@
# Licensed under the MIT license.
# native lib
import sys
import uuid
from enum import Enum
from typing import Union
# private lib
from maro.utils import InternalLogger
from maro.utils.exit_code import NON_RESTART_EXIT_CODE
from .utils import session_id_generator
logger = InternalLogger(component_name="message")
class SessionType(Enum):
"""Communication session categories.
@ -113,5 +106,4 @@ class SessionMessage(Message):
elif self.session_type == SessionType.NOTIFICATION:
self.session_stage = session_stage if session_stage else NotificationSessionStage.REQUEST
else:
logger.error(f"Receive unrecognized session type {self.session_type}, please use the SessionType class.")
sys.exit(NON_RESTART_EXIT_CODE)
raise KeyError(f'Unsupported session type {self.session_type}.')