我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用xbmc.LOGNONE。
def log(msg, level=xbmc.LOGNOTICE): """ Outputs message to log file :param msg: message to output :param level: debug levelxbmc. Values: xbmc.LOGDEBUG = 0 xbmc.LOGERROR = 4 xbmc.LOGFATAL = 6 xbmc.LOGINFO = 1 xbmc.LOGNONE = 7 xbmc.LOGNOTICE = 2 xbmc.LOGSEVERE = 5 xbmc.LOGWARNING = 3 """ log_message = u'{0}: {1}'.format(addonID, msg) xbmc.log(log_message.encode("utf-8"), level)
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])
def emit(self, record): levels = { logging.CRITICAL: xbmc.LOGFATAL, logging.ERROR: xbmc.LOGERROR, logging.WARNING: xbmc.LOGWARNING, logging.INFO: xbmc.LOGINFO, logging.DEBUG: xbmc.LOGDEBUG, logging.NOTSET: xbmc.LOGNONE, } if get_setting_as_bool('debug'): try: xbmc.log(self.format(record), levels[record.levelno]) except UnicodeEncodeError: xbmc.log(self.format(record).encode( 'utf-8', 'ignore'), levels[record.levelno])
def debugTrace(data): if ifDebug(): log = "VPN Mgr Debug: " + data xbmc.log(msg=log, level=xbmc.LOGNONE) else: log = "VPN Mgr : " + data xbmc.log(msg=log, level=xbmc.LOGDEBUG)