main.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:plugin.video.areena 作者: hirsivaja 项目源码 文件源码
def log(txt, log_level=xbmc.LOGDEBUG):
    """
    Log something to the kodi.log file
    :param txt: Text to write to the log
    :param log_level: Severity of the log text
    :return: None
    """
    if (_addon.getSetting("debug") == "true") or (log_level != xbmc.LOGDEBUG):
        if isinstance(txt, str):
            try:
                txt = txt.decode("utf-8")
            except UnicodeDecodeError:
                xbmc.log('Could not decode to Unicode: {0}'.format(txt), level=xbmc.LOGWARNING)
                return
        message = u'%s: %s' % (_addonid, txt)
        xbmc.log(msg=message.encode("utf-8"), level=log_level)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号