# Path: golem/core/logging/abs_logger.py
# class MessageLogger(ABC):
#     def __init__(self):
#         pass
# 
#     @abstractmethod
#     def log_user_message(self, dialog, time, state, message, type_, entities):
#         pass
# 
#     @abstractmethod
#     def log_bot_message(self, dialog, time, state, message):
#         pass
# 
#     def log_error(self, dialog, state, exception):
#         pass
# 
#     def log_user(self, dialog, chat_session):
#         pass


import logging
import time
from django.conf import settings
from golem.core.logging.abs_logger import MessageLogger
        """
        # TODO this has to be called async

        # get raw message text for display
        message_text = entities.get("_message_text")
        if message_text and 'value' in message_text[0]:
            message_text = message_text[0]["value"]
        else:
            message_text = "({})".format(type_)

        for logger in MESSAGE_LOGGERS:
            logger.log_user_message(self.dialog, accepted_time, accepted_state, message_text, type_, entities)

    def log_bot_message(self, message, state):
        for logger in MESSAGE_LOGGERS:
            logger.log_bot_message(self.dialog, int(time.time()), state, message)

    def log_error(self, exception, state):
        for logger in MESSAGE_LOGGERS:
            logger.log_error(self.dialog, state, exception)

    def log_user(self, chat_session):
        for logger in MESSAGE_LOGGERS:
            logger.log_user(self.dialog, chat_session)


MESSAGE_LOGGERS = []


def register_logger(logger):

# Path: golem/core/logging/abs_logger.py
# class MessageLogger(ABC):
#     def __init__(self):
#         pass
# 
#     @abstractmethod
#     def log_user_message(self, dialog, time, state, message, type_, entities):
#         pass
# 
#     @abstractmethod
#     def log_bot_message(self, dialog, time, state, message):
#         pass
# 
#     def log_error(self, dialog, state, exception):
#         pass
# 
#     def log_user(self, dialog, chat_session):
#         pass


# Path: golem/core/logger.py
import logging
import time
from django.conf import settings
from golem.core.logging.abs_logger import MessageLogger

        """
        # TODO this has to be called async

        # get raw message text for display
        message_text = entities.get("_message_text")
        if message_text and 'value' in message_text[0]:
            message_text = message_text[0]["value"]
        else:
            message_text = "({})".format(type_)

        for logger in MESSAGE_LOGGERS:
            logger.log_user_message(self.dialog, accepted_time, accepted_state, message_text, type_, entities)

    def log_bot_message(self, message, state):
        for logger in MESSAGE_LOGGERS:
            logger.log_bot_message(self.dialog, int(time.time()), state, message)

    def log_error(self, exception, state):
        for logger in MESSAGE_LOGGERS:
            logger.log_error(self.dialog, state, exception)

    def log_user(self, chat_session):
        for logger in MESSAGE_LOGGERS:
            logger.log_user(self.dialog, chat_session)


MESSAGE_LOGGERS = []


def register_logger(logger):

    if isinstance(logger, MessageLogger):