當前位置: 首頁>>代碼示例>>Python>>正文


Python xbmc.LOGSEVERE屬性代碼示例

本文整理匯總了Python中xbmc.LOGSEVERE屬性的典型用法代碼示例。如果您正苦於以下問題:Python xbmc.LOGSEVERE屬性的具體用法?Python xbmc.LOGSEVERE怎麽用?Python xbmc.LOGSEVERE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在xbmc的用法示例。


在下文中一共展示了xbmc.LOGSEVERE屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: log

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import LOGSEVERE [as 別名]
def log(self, txt = '', level=xbmc.LOGDEBUG):
        ''' Log a text into the Kodi-Logfile '''
        try:
            if self.detailLevel > 0 or level == xbmc.LOGERROR:
                if self.detailLevel == 2 and level == xbmc.LOGDEBUG:
                    # More Logging
                    level = xbmc.LOGNOTICE
                elif self.detailLevel == 3 and (level == xbmc.LOGDEBUG or level == xbmc.LOGSEVERE):
                    # Complex Logging
                    level = xbmc.LOGNOTICE
                if level != xbmc.LOGSEVERE:
                    if isinstance(txt, unicode):
                        txt = unidecode(txt)
                    xbmc.log(b"[%s] %s" % (self.pluginName, txt), level) 
        except:
            xbmc.log(b"[%s] Unicode Error in message text" % self.pluginName, xbmc.LOGERROR) 
開發者ID:arnesongit,項目名稱:plugin.audio.tidal2,代碼行數:18,代碼來源:debug.py

示例2: emit

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import LOGSEVERE [as 別名]
def emit(self, record):
        if record.levelno < logging.WARNING and self._modules and not record.name in self._modules:
            # Log INFO and DEBUG only with enabled modules
            return
        levels = {
            logging.CRITICAL: xbmc.LOGFATAL,
            logging.ERROR: xbmc.LOGERROR,
            logging.WARNING: xbmc.LOGWARNING,
            logging.INFO: xbmc.LOGNOTICE,
            logging.DEBUG: xbmc.LOGSEVERE,
            logging.NOTSET: xbmc.LOGNONE,
        }
        try:
            xbmc.log(self.format(record), levels[record.levelno])
        except:
            try:
                xbmc.log(self.format(record).encode('utf-8', 'ignore'), levels[record.levelno])
            except:
                xbmc.log(b"[%s] Unicode Error in message text" % self.pluginName, levels[record.levelno]) 
開發者ID:arnesongit,項目名稱:plugin.audio.tidal2,代碼行數:21,代碼來源:debug.py

示例3: log_severe

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import LOGSEVERE [as 別名]
def log_severe(msg):
    log(msg, level=LOGSEVERE) 
開發者ID:bugatsinho,項目名稱:bugatsinho.github.io,代碼行數:4,代碼來源:log.py

示例4: log

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import LOGSEVERE [as 別名]
def log(self, msg, level=xbmc.LOGNOTICE):
        '''
        Writes a string to the XBMC log file. The addon name is inserted into 
        the beginning of the message automatically to help you find relevent 
        messages in the log file.
        
        The available log levels are defined in the :mod:`xbmc` module and are
        currently as follows::
        
            xbmc.LOGDEBUG = 0
            xbmc.LOGERROR = 4
            xbmc.LOGFATAL = 6
            xbmc.LOGINFO = 1
            xbmc.LOGNONE = 7
            xbmc.LOGNOTICE = 2
            xbmc.LOGSEVERE = 5
            xbmc.LOGWARNING = 3
        
        Args:
            msg (str or unicode): The message to be written to the log file.
        
        Kwargs:
            level (int): The XBMC log level to write at.
        '''
        #msg = unicodedata.normalize('NFKD', unicode(msg)).encode('ascii',
        #                                                         'ignore')
        xbmc.log('%s: %s' % (self.get_name(), msg), level) 
開發者ID:iwannabelikemike,項目名稱:plugin.video.sparkle,代碼行數:29,代碼來源:addon.py

示例5: __init__

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import LOGSEVERE [as 別名]
def __init__(self, pluginName, detailLevel=0, enableTidalApiLog=False):
        ''' Initialize Error Logging with a given Log Level
            detailLevel = 0 : xbmc.LOGERROR and xbmc.LOGNOTICE
            detailLevel = 1 : as level 0 plus xbmc.LOGWARNING
            detailLevel = 2 : as level 1 plus xbmc.LOGDEBUG
            detailLevel = 3 : as level 2 plus xbmc.LOGSEVERE
        '''
        self.pluginName = pluginName
        self.detailLevel = detailLevel
        self.debugServer = 'localhost'
        # Set Log Handler for tidalapi
        self.addTidalapiLogger(pluginName, enableDebug=enableTidalApiLog) 
開發者ID:arnesongit,項目名稱:plugin.audio.tidal2,代碼行數:14,代碼來源:debug.py

示例6: log

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import LOGSEVERE [as 別名]
def log(self, msg, level=xbmc.LOGDEBUG):
        '''
        Writes a string to the XBMC log file. The addon name is inserted into 
        the beginning of the message automatically to help you find relevent 
        messages in the log file.
        
        The available log levels are defined in the :mod:`xbmc` module and are
        currently as follows::
        
            xbmc.LOGDEBUG = 0
            xbmc.LOGERROR = 4
            xbmc.LOGFATAL = 6
            xbmc.LOGINFO = 1
            xbmc.LOGNONE = 7
            xbmc.LOGNOTICE = 2
            xbmc.LOGSEVERE = 5
            xbmc.LOGWARNING = 3
        
        Args:
            msg (str or unicode): The message to be written to the log file.
        
        Kwargs:
            level (int): The XBMC log level to write at.
        '''
        #msg = unicodedata.normalize('NFKD', unicode(msg)).encode('ascii',
        #                                                         'ignore')
        xbmc.log('%s: %s' % (self.get_name(), msg), level) 
開發者ID:mrknow,項目名稱:filmkodi,代碼行數:29,代碼來源:addon.py

示例7: log

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import LOGSEVERE [as 別名]
def log(self, msg, level=xbmc.LOGDEBUG):
        '''
        Writes a string to the XBMC log file. The addon name is inserted into
        the beginning of the message automatically to help you find relevent
        messages in the log file.

        The available log levels are defined in the :mod:`xbmc` module and are
        currently as follows::

            xbmc.LOGDEBUG = 0
            xbmc.LOGERROR = 4
            xbmc.LOGFATAL = 6
            xbmc.LOGINFO = 1
            xbmc.LOGNONE = 7
            xbmc.LOGNOTICE = 2
            xbmc.LOGSEVERE = 5
            xbmc.LOGWARNING = 3

        Args:
            msg (str or unicode): The message to be written to the log file.

        Kwargs:
            level (int): The XBMC log level to write at.
        '''
        #msg = unicodedata.normalize('NFKD', unicode(msg)).encode('ascii',
        #                                                         'ignore')
        xbmc.log('%s: %s' % (self.get_name(), msg), level) 
開發者ID:mrknow,項目名稱:filmkodi,代碼行數:29,代碼來源:addon.py


注:本文中的xbmc.LOGSEVERE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。