Python xbmc.LOGNOTICE Examples

The following are 30 code examples of xbmc.LOGNOTICE(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module xbmc , or try the search function .
Example #1
Source File: startup.py    From plugin.program.openwizard with GNU General Public License v3.0 6 votes vote down vote up
def show_notification():
    note_id, msg = window.split_notify(CONFIG.NOTIFICATION)
    
    if note_id:
        if note_id == CONFIG.NOTEID:
            if CONFIG.NOTEDISMISS == 'false':
                window.show_notification(msg)
            else:
                logging.log('[Notifications] No new notifications.', level=xbmc.LOGNOTICE)
        elif note_id > CONFIG.NOTEID:
            logging.log('[Notifications] Showing notification {0}'
                        .format(note_id))
            CONFIG.set_setting('noteid', note_id)
            CONFIG.set_setting('notedismiss', 'false')
            window.show_notification(msg)
    else:
        logging.log('[Notifications] Notifications file at {0} not formatted correctly.'
                    .format(CONFIG.NOTIFICATION),
                    level=xbmc.LOGNOTICE) 
Example #2
Source File: pykodi.py    From script.artwork.beef with MIT License 6 votes vote down vote up
def log(message, level=xbmc.LOGDEBUG, tag=None):
    if is_addon_watched() and level < xbmc.LOGNOTICE:
        # Messages from this add-on are being watched, elevate to NOTICE so Kodi logs it
        level_tag = _log_level_tag_lookup[level] + ': ' if level in _log_level_tag_lookup else ''
        level = xbmc.LOGNOTICE
    else:
        level_tag = ''

    if isinstance(message, (dict, list)) and len(message) > 300:
        message = str(message)
    elif isinstance(message, unicode):
        message = message.encode('utf-8')
    elif not isinstance(message, str):
        message = json.dumps(message, cls=UTF8PrettyJSONEncoder)

    addontag = ADDONID if not tag else ADDONID + ':' + tag
    file_message = '%s[%s] %s' % (level_tag, addontag, scrub_message(message))
    xbmc.log(file_message, level) 
Example #3
Source File: advancedsettings.py    From script.artwork.beef with MIT License 6 votes vote down vote up
def set_arttypes(root, arttype_map):
    for key, artlist in arttype_map.items():
        if key not in mediatype_map:
            if key not in unsupported_types:
                log("Can't set arttypes for '{0}' in advancedsettings.xml".format(key), xbmc.LOGNOTICE)
            continue
        typemap = mediatype_map[key]
        library_elem = root.find(typemap[1])
        if library_elem is None:
            library_elem = ET.SubElement(root, typemap[1])
        mediatype_elem = library_elem.find(typemap[0])
        if artlist:
            if mediatype_elem is None:
                mediatype_elem = ET.SubElement(library_elem, typemap[0])
            else:
                mediatype_elem.clear()
            for arttype in artlist:
                if arttype in typemap[2]:
                    continue
                arttype_elem = ET.SubElement(mediatype_elem, ARTTYPE_TAG)
                arttype_elem.text = arttype
        elif mediatype_elem is not None:
            library_elem.remove(mediatype_elem) 
Example #4
Source File: log_utils.py    From script.module.urlresolver with GNU General Public License v2.0 6 votes vote down vote up
def log(self, msg, level=LOGDEBUG):
        # if debug isn't on, skip disabled loggers unless addon_debug is on
        if not self.__debug_on:
            if self in self.__disabled:
                return
            elif level == LOGDEBUG:
                if self.__addon_debug:
                    level = LOGNOTICE
                else:
                    return

        try:
            if isinstance(msg, six.text_type) and six.PY2:
                msg = '%s (ENCODED)' % (msg.encode('utf-8'))

            xbmc.log('%s: %s' % (self.__name, msg), level)

        except Exception as e:
            try:
                xbmc.log('Logging Failure: %s' % (e), level)
            except:
                pass  # just give up 
Example #5
Source File: log_utils.py    From script.module.resolveurl with GNU General Public License v2.0 6 votes vote down vote up
def log(self, msg, level=LOGDEBUG):
        # if debug isn't on, skip disabled loggers unless addon_debug is on
        if not self.__debug_on:
            if self in self.__disabled:
                return
            elif level == LOGDEBUG:
                if self.__addon_debug:
                    level = LOGNOTICE
                else:
                    return

        try:
            if isinstance(msg, six.text_type) and six.PY2:
                msg = '%s (ENCODED)' % (msg.encode('utf-8'))

            xbmc.log('%s: %s' % (self.__name, msg), level)

        except Exception as e:
            try:
                xbmc.log('Logging Failure: %s' % (e), level)
            except:
                pass  # just give up 
Example #6
Source File: logging.py    From plugin.program.openwizard with GNU General Public License v3.0 6 votes vote down vote up
def show_result(message, url=None):
    from resources.libs.gui import window

    dialog = xbmcgui.Dialog()

    if url:
        try:
            from resources.libs import qr
            
            fn = url.split('/')[-2]
            imagefile = qr.generate_code(url, fn)
            window.show_qr_code("loguploader.xml", imagefile, message)
            try:
                os.remove(imagefile)
            except:
                pass
        except Exception as e:
            log(str(e), xbmc.LOGNOTICE)
            confirm = dialog.ok(CONFIG.ADDONTITLE, "[COLOR %s]%s[/COLOR]" % (CONFIG.COLOR2, message))
    else:
        confirm = dialog.ok(CONFIG.ADDONTITLE, "[COLOR %s]%s[/COLOR]" % (CONFIG.COLOR2, message)) 
Example #7
Source File: antizapret.py    From ru with GNU General Public License v2.0 6 votes vote down vote up
def config():
    global _config
    if not _config:
        with shelf("antizapret.pac_config", ttl=CACHE) as pac:
            if not pac.get("value"):
                xbmc.log("[script.module.antizapret]: Fetching Antizapret PAC file", level=xbmc.LOGNOTICE)
                try:
                    data = urllib2.urlopen(PAC_URL).read()
                except:
                    data = ""

                r = re.search(r"\"PROXY (.*); DIRECT", data)
                pac["value"] = {
                    "server": None,
                    "domains": []
                }
                if r:
                    pac["value"]["server"] = r.group(1)
                    pac["value"]["domains"] = map(lambda x: x.replace(r"\Z(?ms)", "").replace("\\", ""), map(fnmatch.translate, re.findall(r"\"(.*?)\",", data)))

            _config = pac["value"]
    return _config 
Example #8
Source File: logging.py    From plugin.program.openwizard with GNU General Public License v3.0 6 votes vote down vote up
def log(msg, level=xbmc.LOGDEBUG):
    if CONFIG.DEBUGLEVEL == '0':  # No Logging
        return False
    if CONFIG.DEBUGLEVEL == '1':  # Normal Logging
        pass
    if CONFIG.DEBUGLEVEL == '2':  # Full Logging
        level = xbmc.LOGNOTICE
    
    xbmc.log('{0}: {1}'.format(CONFIG.ADDONTITLE, msg), level)
    if CONFIG.ENABLEWIZLOG == 'true':
        if not os.path.exists(CONFIG.WIZLOG):
            with open(CONFIG.WIZLOG, 'w+') as f:
                f.close()

        lastcheck = CONFIG.NEXTCLEANDATE if not CONFIG.NEXTCLEANDATE == 0 else tools.get_date()
        if CONFIG.CLEANWIZLOG == 'true' and time.mktime(time.strptime(lastcheck, "%Y-%m-%d %H:%M:%S")) <= tools.get_date():
            check_log()

        line = "[{0}] {1}".format(tools.get_date(formatted=True), msg)
        line = line.rstrip('\r\n') + '\n'
        tools.write_to_file(CONFIG.WIZLOG, line, mode='a') 
Example #9
Source File: default.py    From bugatsinho.github.io with GNU General Public License v3.0 6 votes vote down vote up
def albums(name, url):
    duplicate = []
    link = GET_url(url)
    try:
        artist_url = regex_from_to(link, 'class="album_report__image"\s*', '"')
        get_artist_icon(name, artist_url)
        xbmc.log("370 name = {0}\nartist_url = {1}".format(name, artist_url), xbmc.LOGNOTICE)
    except:
        pass
    all_albums = re.compile('<div class="album_report"><h5 class="album_report__heading"><a class="album_report__link" href="(.+?)"><img alt="(.+?)" class="album_report__image" src="(.+?)"/><span class="album_report__name">(.+?)</span></a></h5><div cla(.+?)lbum_report__second_line"><span class="album_report__date">(.+?)</span>').findall(link)
    #all_albums = re.compile('<div class="album_report"><h5 class="album_report__heading"><a class="album_report__link" href="(.+?)"><img alt="(.+?)" class="album_report__image" src="(.+?)"/><span class="album_report__name">(.+?)</span></a></h5><div class="album_report__second_line"><span class="album_report__date">(.+?)</span>').findall(link)
    for url1,d1,thumb,album,d2,year in all_albums:
        title = "%s - %s - %s" % (name, album, year)
        if title not in duplicate:
            duplicate.append(title)
            thumb = thumb.replace('al', 'alm').replace('covers', 'mcovers')
            addDir(title.replace('&amp;', 'and'),'http://musicmp3.ru' + url1,5,thumb,'albums')
    setView('movies', 'album') 
Example #10
Source File: default.py    From bugatsinho.github.io with GNU General Public License v3.0 6 votes vote down vote up
def album_list(name, url):
    link = GET_url(url)
    try:
        artist_url = regex_from_to(link, 'class="art_wrap__img" src="', '"')
        get_artist_icon(name, artist_url)
        xbmc.log("348 name = {0}\nartist_url = {1}".format(name, artist_url), xbmc.LOGNOTICE)
    except:
        pass
    all_albums = re.compile('<a class="album_report__link" href="(.+?)"><img alt="(.+?)" class="album_report__image" src="(.+?)"/><span class="album_report__name">(.+?)</span>(.+?)"album_report__artist" href="(.+?)">(.+?)</a>, <span class="album_report__date">(.+?)</span>').findall(link)
    #all_albums = re.compile('<a class="album_report__link" href="(.+?)"><img alt="(.+?)" class="album_report__image" src="(.+?)" /><span class="album_report__name">(.+?)</span>(.+?)"album_report__artist" href="(.+?)">(.+?)</a>, <span class="album_report__date">(.+?)</span>').findall(link)
    for url1,d1,thumb,album,plot,artisturl,artist,year in all_albums:
        title = "%s - %s - %s" % (artist, album, year)
        thumb = thumb.replace('al', 'alm').replace('covers', 'mcovers')
        addDir(title.replace('&amp;', 'and'),'http://musicmp3.ru' + url1,5,thumb,'albums')
    pgnumf = url.find('page=') + 5
    pgnum = int(url[pgnumf:]) + 1
    nxtpgurl = url[:pgnumf]
    nxtpgurl = "%s%s" % (nxtpgurl, pgnum)
    addDir('>> Next page', nxtpgurl, 15, art + 'nextpage.jpg', str(pgnumf))
    setView('movies', 'album') 
Example #11
Source File: debug.py    From plugin.audio.tidal2 with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #12
Source File: debug.py    From plugin.audio.tidal2 with GNU General Public License v3.0 6 votes vote down vote up
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]) 
Example #13
Source File: default.py    From bugatsinho.github.io with GNU General Public License v3.0 6 votes vote down vote up
def Get_Seasons(url, name):#4
    r = client.request(url).decode('latin-1').encode('utf-8')
    episodes = client.parseDOM(r, 'div', attrs={'class': 'tab-content'})[0]
    data = client.parseDOM(r, 'div', attrs={'class': 'VideoPlayer'})[0]
    poster = client.parseDOM(r, 'img', ret='src')[0]
    ss = zip(client.parseDOM(data, 'a', ret='href'),
             client.parseDOM(data, 'a'))
    xbmc.log('@#@SEASONS:%s' % ss, xbmc.LOGNOTICE)
    desc = client.parseDOM(r, 'p', attrs={'class': 'text-dark font-size-13'})[0].encode('latin-1')
    desc = clear_Title(desc)
    for i in ss:
        xbmc.log('@#@FOR-i:%s' % i[1], xbmc.LOGNOTICE)
        season = re.sub('[\n|\t|\r|\s]', '', i[1])
        surl = url + '|' + episodes.encode('utf-8') + '|' + i[0][1:].encode('utf-8') + '|' + str(poster)
        title = '[B][COLOR white]%s [B]| [COLOR lime]%s[/COLOR][/B]' % (name, season)
        addDir(title, surl, 7, poster, FANART, desc)
    setView('movies', 'menu-view') 
Example #14
Source File: loghandler.py    From plugin.video.emby with GNU General Public License v3.0 6 votes vote down vote up
def emit(self, record):

        if self._get_log_level(record.levelno):

            try:
                string = self.format(record)
            except Exception as error:
                xbmc.log("Error trying to format string for log", level=xbmc.LOGNOTICE)

                return

            if self.mask_info:
                for server in self.sensitive['Server']:
                    string = string.replace(server.encode('utf-8') or "{server}", "{emby-server}")

                for token in self.sensitive['Token']:
                    string = string.replace(token.encode('utf-8')  or "{token}", "{emby-token}")

            try:
                xbmc.log(string, level=xbmc.LOGNOTICE)
            except UnicodeEncodeError:
                xbmc.log(string.encode('utf-8'), level=xbmc.LOGNOTICE) 
Example #15
Source File: default.py    From repository.xvbmc with GNU General Public License v2.0 5 votes vote down vote up
def RemovePythonRequestMalware():
    ############################################################################
    # do NOT use Gaia's fake 2.16(.?) version: 'script.module.python.requests' #
    # includes Gaia's Cryptocurrency-mining malware, see: 'connectionpool.py'! #
    ############################################################################
    # +fake: <import addon="script.module.python.requests" version="2.16.0" /> #
    # ...in: "system dependency" ; 'script.module.simplejson' version 3.4.1    #
    ############################################################################
    CryptoCMlwr = os.listdir(xbmc.translatePath(os.path.join('special://home/addons/')))
    addonfolder = xbmc.translatePath(os.path.join('special://home/addons/'))
    for item in CryptoCMlwr:
        if (addon_id) in item:
            print str(CryptoCMlwr)+" CryptoCMlwr="+str(item)
            xbmc.log("CryptoCMlwr="+'\''+str(item)+'\'',level=xbmc.LOGNOTICE)
            try:
                shutil.rmtree(addonfolder+item, ignore_errors=True)
            except:
                pass
            try:
                os.unlink(addonfolder+item)
            except:
                pass;
            try:
                os.rmdir(addonfolder+item)
            except:
                pass;
        else:
            pass
    xbmc.executebuiltin("Container.Refresh")
    xbmc.sleep(30)
    xbmc.executebuiltin("XBMC.ActivateWindow(home)")
    xbmc.sleep(60)
    xbmc.executebuiltin('ReloadSkin()')
    xbmc.sleep(90)
    xbmc.executebuiltin('XBMC.UpdateLocalAddons()')
    return 
Example #16
Source File: log_utils.py    From script.module.resolveurl with GNU General Public License v2.0 5 votes vote down vote up
def log_notice(self, msg):
        self.log(msg, level=LOGNOTICE) 
Example #17
Source File: default.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
def main():
    if os.path.exists(_PVR_CONFIG):
        dialog = xbmcgui.Dialog()
        reply = dialog.yesno(
            _LANGUAGE(100612).encode('utf-8'), _LANGUAGE(100613).encode('utf-8'), _LANGUAGE(100614).encode('utf-8'))
        if reply:
            try:
                if _ADDON.getSetting('local') == 'true':
                    path = _ADDON.getSetting('path')
                    xbmc.log(_ADDON_NAME + ': Opening m3u file ' + path, xbmc.LOGNOTICE)
                    playlist = open(path, mode='r')
                else:
                    url = _ADDON.getSetting('url')
                    xbmc.log(_ADDON_NAME + ': Opening m3u url ' + url, xbmc.LOGNOTICE)
                    playlist = urllib2.urlopen(url)
            except (urllib2.URLError, ValueError, IOError):
                xbmc.log(_ADDON_NAME + ': Playlist not found', xbmc.LOGERROR)
                xbmc.executebuiltin('Notification(' +
                            _LANGUAGE(100605).encode('utf-8') + ',' + _LANGUAGE(100606).encode('utf-8') + '), 3000')
            else:
                entries_count = convert_file(playlist)
                if entries_count:
                    channels = str(entries_count)
                    xbmc.log(_ADDON_NAME + ': Successfully imported ' + channels + ' channels', xbmc.LOGNOTICE)
                    dialog.ok(  _LANGUAGE(100607).encode('utf-8'),
                                _LANGUAGE(100608).encode('utf-8') + ' ' + channels,
                                _LANGUAGE(100615).encode('utf-8'),
                                _LANGUAGE(100616).encode('utf-8'))
                else:
                    xbmc.log(_ADDON_NAME + ': Invalid playlist', xbmc.LOGERROR)
                    xbmc.executebuiltin('Notification(' +
                        _LANGUAGE(100609).encode('utf-8') + ',' + _LANGUAGE(100610).encode('utf-8') + '), 3000')
    else:
        xbmc.log(_ADDON_NAME + ': pvr.demo addon not found', xbmc.LOGERROR)
        xbmc.executebuiltin('Notification(' +
            _LANGUAGE(100609).encode('utf-8') + ',' + _LANGUAGE(100611).encode('utf-8') + '), 3000') 
Example #18
Source File: XbmcHelpers.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
def log(description, level=0):
    if dbg and dbglevel > level:
        try:
            xbmc.log((u"[%s] %s : '%s'" % (plugin, inspect.stack()[1][3], description)).decode("utf-8"), xbmc.LOGNOTICE)
        except:
            xbmc.log(u"FALLBACK [%s] %s : '%s'" % (plugin, inspect.stack()[1][3], repr(description)), xbmc.LOGNOTICE) 
Example #19
Source File: CommonFunctions.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
def log(description, level=0):
    if dbg and dbglevel > level:
        try:
            xbmc.log((u"[%s] %s : '%s'" % (plugin, inspect.stack()[1][3], description)).decode("utf-8"), xbmc.LOGNOTICE)
        except:
            xbmc.log(u"FALLBACK [%s] %s : '%s'" % (plugin, inspect.stack()[1][3], repr(description)), xbmc.LOGNOTICE) 
Example #20
Source File: utils.py    From script.module.clouddrive.common with GNU General Public License v3.0 5 votes vote down vote up
def log(msg, level):
        import xbmc
        from clouddrive.common.utils import Utils
        if level == 0:
            level = xbmc.LOGDEBUG
        elif level == 1:
            level = xbmc.LOGNOTICE
        elif level == 2:
            level = xbmc.LOGWARNING
        elif level == 3:
            level = xbmc.LOGERROR
        xbmc.log('[%s][%s-%s]: %s' % (KodiUtils.get_addon_info('id'), threading.current_thread().name,threading.current_thread().ident, Utils.str(msg)), level) 
Example #21
Source File: logger.py    From addon with GNU General Public License v3.0 5 votes vote down vote up
def debug(texto="", force=False):
    if loggeractive or force:
        texto = "    [" + get_caller() + "] " + encode_log(texto)

        xbmc.log("######## DEBUG #########", xbmc.LOGNOTICE)
        xbmc.log(texto, xbmc.LOGNOTICE) 
Example #22
Source File: advancedsettings.py    From script.artwork.beef with MIT License 5 votes vote down vote up
def save_backup():
    if xbmcvfs.exists(FILENAME):
        xbmcvfs.copy(FILENAME, FILENAME_BAK)
        result = xbmcvfs.exists(FILENAME_BAK)
        if result:
            xbmcgui.Dialog().notification("Artwork Beef", L(BACKUP_SUCCESSFUL))
        else:
            xbmcgui.Dialog().notification("Artwork Beef", L(BACKUP_UNSUCCESSFUL), xbmc.LOGWARNING)
        return result
    log("advancedsettings.xml doesn't exist, can't save backup", xbmc.LOGNOTICE)
    return True 
Example #23
Source File: utils.py    From plugin.video.themoviedb.helper with GNU General Public License v3.0 5 votes vote down vote up
def kodi_log(value, level=0):
    try:
        if isinstance(value, bytes):
            value = value.decode('utf-8')
        logvalue = u'{0}{1}'.format(_addonlogname, value)
        if sys.version_info < (3, 0):
            logvalue = logvalue.encode('utf-8', 'ignore')
        if level == 2 and _debuglogging:
            xbmc.log(logvalue, level=xbmc.LOGNOTICE)
        elif level == 1:
            xbmc.log(logvalue, level=xbmc.LOGNOTICE)
        else:
            xbmc.log(logvalue, level=xbmc.LOGDEBUG)
    except Exception as exc:
        xbmc.log(u'Logging Error: {}'.format(exc), level=xbmc.LOGNOTICE) 
Example #24
Source File: startup.py    From plugin.program.openwizard with GNU General Public License v3.0 5 votes vote down vote up
def save_trakt():
    current_time = time.mktime(time.strptime(tools.get_date(formatted=True), "%Y-%m-%d %H:%M:%S"))
    next_save = time.mktime(time.strptime(CONFIG.get_setting('traktnextsave'), "%Y-%m-%d %H:%M:%S"))
    
    if next_save <= current_time:
        from resources.libs import traktit
        logging.log("[Trakt Data] Saving all Data", level=xbmc.LOGNOTICE)
        traktit.auto_update('all')
        CONFIG.set_setting('traktnextsave', tools.get_date(days=3, formatted=True))
    else:
        logging.log("[Trakt Data] Next Auto Save isn't until: {0} / TODAY is: {1}".format(CONFIG.get_setting('traktnextsave'),
                                                                                          tools.get_date(formatted=True)),
                    level=xbmc.LOGNOTICE) 
Example #25
Source File: api.py    From plugin.video.crunchyroll with GNU Affero General Public License v3.0 5 votes vote down vote up
def request(args, method, options, failed=False):
    """Make Crunchyroll JSON API call
    """
    # required in every request
    payload = {"version": API.VERSON,
               "locale":  args._subtitle}

    # if not new session add access token
    if not method == "start_session":
        payload["session_id"] = args._session_id

    # merge payload with parameters
    payload.update(options)
    payload = urlencode(payload)

    # send payload
    url = API.URL + method + ".0.json"
    response = urlopen(url, payload.encode("utf-8"))

    # parse response
    json_data = response.read().decode("utf-8")
    json_data = json.loads(json_data)

    # check for error
    if json_data["error"]:
        xbmc.log("[PLUGIN] %s: API returned error '%s'" % (args._addonname, str(json_data)), xbmc.LOGNOTICE)
        args._session_restart = True
        if not failed:
            # retry request, session expired
            start(args)
            return request(args, method, options, True)
        elif failed:
            # destroy session
            destroy(args)

    return json_data 
Example #26
Source File: default.py    From kodi with GNU General Public License v3.0 5 votes vote down vote up
def log(msg, level=xbmc.LOGNOTICE):
    log_message = u'{0}: {1}'.format('hdrezka', msg)
    xbmc.log(log_message.encode("utf-8"), level) 
Example #27
Source File: default.py    From kodi with GNU General Public License v3.0 5 votes vote down vote up
def log(msg, level=xbmc.LOGNOTICE):
    log_message = u'{0}: {1}'.format('yandex.music', msg)
    xbmc.log(log_message.encode("utf-8"), level) 
Example #28
Source File: XbmcHelpers.py    From kodi with GNU General Public License v3.0 5 votes vote down vote up
def log(description, level=0):
    if dbg and dbglevel > level:
        try:
            xbmc.log((u"[%s] %s : '%s'" % (plugin, inspect.stack()[1][3], description)).decode("utf-8"), xbmc.LOGNOTICE)
        except:
            xbmc.log(u"FALLBACK [%s] %s : '%s'" % (plugin, inspect.stack()[1][3], repr(description)), xbmc.LOGNOTICE) 
Example #29
Source File: startup.py    From plugin.program.openwizard with GNU General Public License v3.0 5 votes vote down vote up
def save_login():
    current_time = time.mktime(time.strptime(tools.get_date(formatted=True), "%Y-%m-%d %H:%M:%S"))
    next_save = time.mktime(time.strptime(CONFIG.get_setting('loginnextsave'), "%Y-%m-%d %H:%M:%S"))
    
    if next_save <= current_time:
        from resources.libs import loginit
        logging.log("[Login Info] Saving all Data", level=xbmc.LOGNOTICE)
        loginit.auto_update('all')
        CONFIG.set_setting('loginnextsave', tools.get_date(days=3, formatted=True))
    else:
        logging.log("[Login Info] Next Auto Save isn't until: {0} / TODAY is: {1}".format(CONFIG.get_setting('loginnextsave'),
                                                                                          tools.get_date(formatted=True)),
                    level=xbmc.LOGNOTICE) 
Example #30
Source File: startup.py    From plugin.program.openwizard with GNU General Public License v3.0 5 votes vote down vote up
def save_debrid():
    current_time = time.mktime(time.strptime(tools.get_date(formatted=True), "%Y-%m-%d %H:%M:%S"))
    next_save = time.mktime(time.strptime(CONFIG.get_setting('debridnextsave'), "%Y-%m-%d %H:%M:%S"))
    
    if next_save <= current_time:
        from resources.libs import debridit
        logging.log("[Debrid Data] Saving all Data", level=xbmc.LOGNOTICE)
        debridit.auto_update('all')
        CONFIG.set_setting('debridnextsave', tools.get_date(days=3, formatted=True))
    else:
        logging.log("[Debrid Data] Next Auto Save isn't until: {0} / TODAY is: {1}".format(CONFIG.get_setting('debridnextsave'),
                                                                                           tools.get_date(formatted=True)),
                    level=xbmc.LOGNOTICE)