Logger#

class sopel.logger.ChannelOutputFormatter(fmt='[%(filename)s] %(message)s', datefmt=None)#

Output formatter for log messages destined for an IRC channel.

Parameters:

Implementation of a logging.Formatter.

formatException(exc_info)#

Format the exception info as a string for output.

Parameters:

exc_info (tuple) – standard exception information returned by exc_info()

class sopel.logger.IrcLoggingHandler(bot, level)#

Logging handler for output to an IRC channel.

Parameters:

Implementation of a logging.Handler.

emit(record)#

Emit a log record to the IRC channel.

Parameters:

record (logging.LogRecord) – the log record to output

sopel.logger.get_logger(name=None)#

Return a logger for a module, if the name is given.

Deprecated since version 7.0: Sopel’s own code should use logging.getLogger(__name__) instead, and external plugins should use sopel.tools.get_logger().

This will emit a deprecation warning in Sopel 8.0, and it will be removed in Sopel 9.0.

sopel.logger.setup_logging(settings)#

Set up logging based on the bot’s configuration settings.

Parameters:

settings (sopel.config.Config) – configuration settings object