本文整理汇总了Python中xbmc.LOGINFO属性的典型用法代码示例。如果您正苦于以下问题:Python xbmc.LOGINFO属性的具体用法?Python xbmc.LOGINFO怎么用?Python xbmc.LOGINFO使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类xbmc
的用法示例。
在下文中一共展示了xbmc.LOGINFO属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_log_level
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def get_log_level():
"""
Lazily read the log level settings
"""
# pylint: disable=global-statement
global __LOG_LEVEL__
if __LOG_LEVEL__ is None:
try:
__LOG_LEVEL__ = g.ADDON.getSettingString('debug_log_level')
if __LOG_LEVEL__ != 'Disabled':
_log('Debug logging level is {}'.format(__LOG_LEVEL__), xbmc.LOGINFO)
except Exception: # pylint: disable=broad-except
# If settings.xml was not created yet, as at first service run
# g.ADDON.getSettingString('debug_log_level') will thrown a TypeError
# If any other error appears, we don't want the service to crash,
# let's return 'Disabled' in all case
__LOG_LEVEL__ = 'Disabled'
return __LOG_LEVEL__
示例2: log_info
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def log_info(msg):
log(msg, level=LOGINFO)
示例3: info
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def info(msg, *args, **kwargs):
"""Log an info message."""
if get_log_level() == 'Disabled':
return
_log(msg, xbmc.LOGINFO, *args, **kwargs)
示例4: log
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [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)
示例5: info
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def info(self, message):
self._log(message, xbmc.LOGINFO)
示例6: _get_data
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def _get_data(self, url, params):
apikey = settings.get_apikey('tadb')
if not apikey:
raise build_key_error('tadb')
self.log('uncached', xbmc.LOGINFO)
response = self.doget(url, params=params)
if response is None:
raise build_key_error('tadb')
return 'Empty' if response is None else json.loads(response.text, cls=UTF8JSONDecoder)
示例7: _get_data
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def _get_data(self, mediaid, arttype, language):
if not settings.get_apikey('tvdb'):
raise build_key_error('tvdb')
self.log('uncached', xbmc.LOGINFO)
getparams = {'params': {'keyType': arttype}, 'headers': {'Accept-Language': language}}
response = self.doget(self.apiurl % mediaid, **getparams)
return 'Empty' if response is None else json.loads(response.text, cls=UTF8JSONDecoder)
示例8: _get_data
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def _get_data(self, url):
apikey = settings.get_apikey('tmdb')
if not apikey:
raise build_key_error('tmdb')
self.log('uncached', xbmc.LOGINFO)
response = self.doget(url, params={'api_key': apikey})
return 'Empty' if response is None else json.loads(response.text, cls=UTF8JSONDecoder)
示例9: _get_seasonnum
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def _get_seasonnum(self, image, itemname, ignoreall=False):
allitem = None if ignoreall else -1
if 'season' not in image:
return None
try:
return int(image['season']) if image['season'] != 'all' else allitem
except ValueError:
if not ignoreall:
self.log("Image season was set incorrectly for '%s', to \"%s\", so I can't tell which season "
"it belongs to. The image URL is:\n%s" % (itemname, image['season'], image['url']), xbmc.LOGINFO)
# throw it into the 'all seasons' image pile
return allitem
示例10: notify_count
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def notify_count(message, count):
countmessage = message.format(count)
log(countmessage, xbmc.LOGINFO)
xbmcgui.Dialog().notification('Artwork Beef', countmessage)
示例11: info
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def info(self, message, *args):
""" Outputs an info message """
self._log(xbmc.LOGINFO, message, *args)
示例12: log
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def log(message,loglevel=xbmc.LOGNOTICE):
""""save message to kodi.log.
Args:
message: has to be unicode, http://wiki.xbmc.org/index.php?title=Add-on_unicode_paths#Logging
loglevel: xbmc.LOGDEBUG, xbmc.LOGINFO, xbmc.LOGNOTICE, xbmc.LOGWARNING, xbmc.LOGERROR, xbmc.LOGFATAL
"""
xbmc.log(encode(__addon_id__ + u": " + message), level=loglevel)
示例13: log
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [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)
示例14: _log
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def _log(self, msg='', level=None, args=None):
plugin = "plugin.video.mrknow"
if isinstance(msg, unicode):
msg = msg.encode('utf-8')
else:
msg = str(msg)
if args:
msg += ' ' + ' '.join(args)
if xbmc:
if level is None:
level = LOGINFO
xbmc.log("[%s] %s" % (plugin, msg), level)
else:
print("[%s] %s" % (plugin, msg))
示例15: info
# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import LOGINFO [as 别名]
def info(self, msg, *args):
self._log(msg, args=args, level=LOGINFO)