Python xbmc.LOGINFO Examples

The following are 19 code examples of xbmc.LOGINFO(). 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: logging.py    From plugin.video.netflix with MIT License 6 votes vote down vote up
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__ 
Example #2
Source File: addon.py    From filmkodi with Apache License 2.0 5 votes vote down vote up
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) 
Example #3
Source File: log.py    From bugatsinho.github.io with GNU General Public License v3.0 5 votes vote down vote up
def log_info(msg):
    log(msg, level=LOGINFO) 
Example #4
Source File: mrknow_pLog.py    From filmkodi with Apache License 2.0 5 votes vote down vote up
def info(self, msg, *args):
        self._log(msg, args=args, level=LOGINFO) 
Example #5
Source File: mrknow_pLog.py    From filmkodi with Apache License 2.0 5 votes vote down vote up
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)) 
Example #6
Source File: addon.py    From filmkodi with Apache License 2.0 5 votes vote down vote up
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) 
Example #7
Source File: utils.py    From plugin.video.bdyun with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #8
Source File: utils.py    From xbmc-addons-chinese with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #9
Source File: kodilogger.py    From plugin.video.mediathekview with MIT License 5 votes vote down vote up
def info(self, message, *args):
        """ Outputs an info message """
        self._log(xbmc.LOGINFO, message, *args) 
Example #10
Source File: default.py    From script.artwork.beef with MIT License 5 votes vote down vote up
def notify_count(message, count):
    countmessage = message.format(count)
    log(countmessage, xbmc.LOGINFO)
    xbmcgui.Dialog().notification('Artwork Beef', countmessage) 
Example #11
Source File: fanarttv.py    From script.artwork.beef with MIT License 5 votes vote down vote up
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 
Example #12
Source File: themoviedb.py    From script.artwork.beef with MIT License 5 votes vote down vote up
def _get_data(self, url, params=None):
        apikey = settings.get_apikey('tmdb')
        if not apikey:
            raise build_key_error('tmdb')
        self.log('uncached', xbmc.LOGINFO)
        if params is None:
            params = {'api_key': apikey}
        else:
            params = dict(params, api_key=apikey)
        response = self.doget(url, params=params)
        return 'Empty' if response is None else response.json() 
Example #13
Source File: themoviedb.py    From script.artwork.beef with MIT License 5 votes vote down vote up
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) 
Example #14
Source File: thetvdbv2.py    From script.artwork.beef with MIT License 5 votes vote down vote up
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) 
Example #15
Source File: theaudiodb.py    From script.artwork.beef with MIT License 5 votes vote down vote up
def _get_data(self, url, params=None):
        self.log('uncached', xbmc.LOGINFO)
        if params is None:
            params = {}
        response = self.doget(url, params=params)
        if response is None:
            raise build_key_error('tadb')
        return 'Empty' if response is None else response.json() 
Example #16
Source File: theaudiodb.py    From script.artwork.beef with MIT License 5 votes vote down vote up
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) 
Example #17
Source File: logger.py    From kodi.kino.pub with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def info(self, message):
        self._log(message, xbmc.LOGINFO) 
Example #18
Source File: addon.py    From plugin.video.sparkle with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #19
Source File: logging.py    From plugin.video.netflix with MIT License 5 votes vote down vote up
def info(msg, *args, **kwargs):
    """Log an info message."""
    if get_log_level() == 'Disabled':
        return
    _log(msg, xbmc.LOGINFO, *args, **kwargs)