python类LOGNOTICE的实例源码

logger.py 文件源码 项目:pelisalacarta-ce 作者: pelisalacarta-ce 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def info(texto=""):
    if loggeractive:
        xbmc.log(get_caller(encode_log(texto)), xbmc.LOGNOTICE)
logger.py 文件源码 项目:pelisalacarta-ce 作者: pelisalacarta-ce 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def debug(texto=""):
    if loggeractive:
        texto = "    [" + get_caller() + "] " + encode_log(texto)

        xbmc.log("######## DEBUG #########", xbmc.LOGNOTICE)
        xbmc.log(texto, xbmc.LOGNOTICE)
plugintools.py 文件源码 项目:pelisalacarta-ce 作者: pelisalacarta-ce 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def log(message):
    if application_log_enabled:
        xbmc.log(message, xbmc.LOGNOTICE)

# Write this module messages on XBMC log
plugintools.py 文件源码 项目:pelisalacarta-ce 作者: pelisalacarta-ce 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def _log(message):
    if module_log_enabled:
        xbmc.log("plugintools."+message, xbmc.LOGNOTICE)

# Parse XBMC params - based on script.module.parsedom addon
utils.py 文件源码 项目:script.module.metadatautils 作者: marcelveldt 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def log_msg(msg, loglevel=xbmc.LOGDEBUG):
    '''log message to kodi logfile'''
    if isinstance(msg, unicode):
        msg = msg.encode('utf-8')
    if loglevel == xbmc.LOGDEBUG and FORCE_DEBUG_LOG:
        loglevel = xbmc.LOGNOTICE
    xbmc.log("%s --> %s" % (ADDON_ID, msg), level=loglevel)
utils.py 文件源码 项目:script.module.metadatautils 作者: marcelveldt 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def rate_limiter(rl_params):
    ''' A very basic rate limiter which limits to 1 request per X seconds to the api'''
    # Please respect the parties providing these free api's to us and do not modify this code.
    # If I suspect any abuse I will revoke all api keys and require all users
    # to have a personal api key for all services.
    # Thank you
    if not rl_params:
        return
    monitor = xbmc.Monitor()
    win = xbmcgui.Window(10000)
    rl_name = rl_params[0]
    rl_delay = rl_params[1]
    cur_timestamp = int(time.mktime(datetime.datetime.now().timetuple()))
    prev_timestamp = try_parse_int(win.getProperty("ratelimiter.%s" % rl_name))
    if (prev_timestamp + rl_delay) > cur_timestamp:
        sec_to_wait = (prev_timestamp + rl_delay) - cur_timestamp
        log_msg(
            "Rate limiter active for %s - delaying request with %s seconds - "
            "Configure a personal API key in the settings to get rid of this message and the delay." %
            (rl_name, sec_to_wait), xbmc.LOGNOTICE)
        while sec_to_wait and not monitor.abortRequested():
            monitor.waitForAbort(1)
            # keep setting the timestamp to create some sort of queue
            cur_timestamp = int(time.mktime(datetime.datetime.now().timetuple()))
            win.setProperty("ratelimiter.%s" % rl_name, "%s" % cur_timestamp)
            sec_to_wait -= 1
    # always set the timestamp
    cur_timestamp = int(time.mktime(datetime.datetime.now().timetuple()))
    win.setProperty("ratelimiter.%s" % rl_name, "%s" % cur_timestamp)
    del monitor
    del win
logger.py 文件源码 项目:plugin.video.streamondemand-pureita 作者: orione7 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def info(texto=""):
    if loggeractive:
        xbmc.log(get_caller(encode_log(texto)), xbmc.LOGNOTICE)
logger.py 文件源码 项目:plugin.video.streamondemand-pureita 作者: orione7 项目源码 文件源码 阅读 41 收藏 0 点赞 0 评论 0
def debug(texto=""):
    if loggeractive:
        texto = "    [" + get_caller() + "] " + encode_log(texto)

        xbmc.log("######## DEBUG #########", xbmc.LOGNOTICE)
        xbmc.log(texto, xbmc.LOGNOTICE)
common.py 文件源码 项目:plugin.video.amazon65 作者: phil65 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def Log(msg, level=xbmc.LOGNOTICE):
    if level == xbmc.LOGDEBUG and verbLog:
        level = xbmc.LOGNOTICE
    if isinstance(msg, unicode):
        msg = msg.encode('utf-8')
    WriteLog(msg)
    xbmc.log('[%s] %s' % (__plugin__, msg.__str__()), level)
log_utils.py 文件源码 项目:plugin.program.indigo 作者: tvaddonsco 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def log(msg, level=xbmc.LOGNOTICE):
    # override message level to force logging when addon logging turned on
    if addon.getSetting('debug') == 'true' and level == xbmc.LOGDEBUG:
        level = xbmc.LOGNOTICE

    try: xbmc.log('%s: %s' % (name, msg), level)
    except:
        try: xbmc.log('Logging Failure', level)
        except: pass  # just give up
kodi.py 文件源码 项目:plugin.program.indigo 作者: tvaddonsco 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def log(msg, level=xbmc.LOGNOTICE):
    name = str(AddonTitle) + ' NOTICE'
    # override message level to force logging when addon logging turned on
    level = xbmc.LOGNOTICE

    try:
        xbmc.log('%s: %s' % (name, msg), level)
    except:
        try:
            xbmc.log('Logging Failure', level)
        except:
            pass  # just give up
kodi.py 文件源码 项目:plugin.program.indigo 作者: tvaddonsco 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def logInfo(msg, level=xbmc.LOGNOTICE):
    name = AddonTitle + ' INFORMATION'
    # override message level to force logging when addon logging turned on
    level = xbmc.LOGNOTICE

    try:
        xbmc.log('%s: %s' % (name, msg), level)
    except:
        try:
            xbmc.log('Logging Failure', level)
        except:
            pass  # just give up
utils.py 文件源码 项目:script.reddit.reader 作者: gedisony 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def log(message):
    import threading
    t=threading.currentThread()
    show_debug_messages=addon.getSetting("show_debug_messages") == "true"
    if show_debug_messages:
        level=xbmc.LOGNOTICE
    else:
        level=xbmc.LOGDEBUG
    try:
        xbmc.log("reddit_reader {0}:{1}".format(t.name, message), level=level)
    except TypeError as e:
        xbmc.log("reddit_reader error:{0}".format(e), level=level)
addon.py 文件源码 项目:plugin.video.zdf_de_2016 作者: generia 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def info(self, message, *args):
        self._log(xbmc.LOGNOTICE, message, *args)
__init__.py 文件源码 项目:plugin.video.giraffe.seasonvar 作者: weirdgiraffe 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def info(s):
        xbmc.log(s, xbmc.LOGNOTICE)
addon.py 文件源码 项目:Bassdrive-Kodi-Plugin 作者: geudrik 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def log(self, msg):
        xbmc.log("[Bassdrive Plugin] %s" % (msg), xbmc.LOGNOTICE)
addon.py 文件源码 项目:Kodi-Launches-EmulationStation-Addon 作者: BrosMakingSoftware 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def log(message, level=xbmc.LOGNOTICE):
    xbmc.log('[%s:v%s] %s' % (__addonId__, __version__, message.encode('utf-8')), level)
# end of log

# Starting the Addon
kodijsonrpc.py 文件源码 项目:plex-for-kodi-mod 作者: mrclemds 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __call__(self, *args, **kwargs):
        args = [str(a).replace(',', '\,') for a in args]
        for k, v in kwargs.items():
            args.append('{0}={v}'.format(k, str(v).replace(',', '\,')))

        if args:
            command = '{0}({1})'.format(self.module, ','.join(args))
        else:
            command = '{0}'.format(self.module)

        xbmc.log(command, xbmc.LOGNOTICE)

        xbmc.executebuiltin(command)
main.py 文件源码 项目:plex-for-kodi-mod 作者: mrclemds 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def realExit():
    xbmc.log('script.plex: REALLY FINISHED', xbmc.LOGNOTICE)
util.py 文件源码 项目:plex-for-kodi-mod 作者: mrclemds 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def LOG(msg, level=xbmc.LOGNOTICE):
    xbmc.log('script.plex: {0}'.format(msg), level)


问题


面经


文章

微信
公众号

扫码关注公众号