src.themerr.logger#
- class src.themerr.logger.Logger[source]#
Bases:
object
Themerr’s logger class.
Creates a new logger to log to the Kodi log.
Examples
>>> logger = Logger()
- Attributes:
- notifierNotifier
The notifier to use to display notifications to the user.
- iconsdict
A dictionary mapping log levels to notification icons.
- level_mapperdict
A dictionary mapping log levels to strings.
Methods
log(msg: str, level: int = xbmc.LOGDEBUG)
Log a message to the Kodi log.
debug(msg: str)
Log a debug message to the Kodi log.
info(msg: str)
Log an info message to the Kodi log.
warning(msg: str)
Log a warning message to the Kodi log.
error(msg: str)
Log an error message to the Kodi log.
fatal(msg: str)
Log a fatal message to the Kodi log.
- debug(msg: str)[source]#
Log a debug message to the Kodi log.
Passes the message to the log method with the debug log level.
- Parameters:
- msgstr
The message to log.
Examples
>>> logger = Logger() >>> logger.debug("This is a debug message")
- error(msg: str)[source]#
Log an error message to the Kodi log.
Passes the message to the log method with the error log level.
- Parameters:
- msgstr
The message to log.
Examples
>>> logger = Logger() >>> logger.error("This is an error message")
- fatal(msg: str)[source]#
Log a fatal message to the Kodi log.
Passes the message to the log method with the fatal log level.
- Parameters:
- msgstr
The message to log.
Examples
>>> logger = Logger() >>> logger.fatal("This is a fatal message")
- info(msg: str)[source]#
Log an info message to the Kodi log.
Passes the message to the log method with the info log level.
- Parameters:
- msgstr
The message to log.
Examples
>>> logger = Logger() >>> logger.info("This is an info message")
- log(msg: str, level: int = 0)[source]#
Log a message to the Kodi log.
This method will log a debug message to the Kodi log. The level parameter will be included in the log message. Additionally, a notification will be displayed to the user if the addon is in development mode.
- Parameters:
- msgstr
The message to log.
- levelint
The log level to log the message at.
Examples
>>> logger = Logger() >>> logger.log("This is a debug message", xbmc.LOGDEBUG)