# Path: resources/lib/core/logger/abstractlogger.py
# class AbstractLogger:
#     __metaclass__ = ABCMeta
# 
#     LEVELS = {
#         'debug': 0,
#         'info': 1,
#         'notice': 2,
#         'warning': 3,
#         'error': 4,
#         'severe': 5,
#         'fatal': 6
#     }
# 
#     def __init__(self, log_level):
#         self.log_level = log_level
# 
#     @abstractmethod
#     def debug(self, channel, text):
#         pass
# 
#     @abstractmethod
#     def info(self, channel, text):
#         pass
# 
#     @abstractmethod
#     def warning(self, channel, text):
#         pass
# 
#     @abstractmethod
#     def error(self, channel, text):
#         pass
# 
#     @abstractmethod
#     def critical(self, channel, text):
#         pass


import xbmc
from resources.lib.core.logger.abstractlogger import AbstractLogger



class Logger(AbstractLogger):
    def debug(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGDEBUG)

    def info(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGNOTICE)

    def warning(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGWARNING)

    def error(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGERROR)

    def critical(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGSEVERE)

    def _format(self, channel, text):
        text = str(text)

# Path: resources/lib/core/logger/abstractlogger.py
# class AbstractLogger:
#     __metaclass__ = ABCMeta
# 
#     LEVELS = {
#         'debug': 0,
#         'info': 1,
#         'notice': 2,
#         'warning': 3,
#         'error': 4,
#         'severe': 5,
#         'fatal': 6
#     }
# 
#     def __init__(self, log_level):
#         self.log_level = log_level
# 
#     @abstractmethod
#     def debug(self, channel, text):
#         pass
# 
#     @abstractmethod
#     def info(self, channel, text):
#         pass
# 
#     @abstractmethod
#     def warning(self, channel, text):
#         pass
# 
#     @abstractmethod
#     def error(self, channel, text):
#         pass
# 
#     @abstractmethod
#     def critical(self, channel, text):
#         pass


# Path: resources/lib/core/logger/logger.py
import xbmc
from resources.lib.core.logger.abstractlogger import AbstractLogger




class Logger(AbstractLogger):
    def debug(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGDEBUG)

    def info(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGNOTICE)

    def warning(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGWARNING)

    def error(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGERROR)

    def critical(self, channel, text):
        xbmc.log(self._format(channel, text), xbmc.LOGSEVERE)

    def _format(self, channel, text):
        text = str(text)

        return '[%s]: %s' % (channel, text)