Python xbmc.LOGFATAL Examples

The following are 7 code examples of xbmc.LOGFATAL(). 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: 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 #2
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 #3
Source File: logger.py    From kodi.kino.pub with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def fatal(self, message):
        self._log(message, xbmc.LOGFATAL) 
Example #4
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 #5
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 #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: 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)