module documentation

Undocumented

Class LogCounterHandler Record log levels count into a crawler stats
Class StreamLogger Fake file-like stream object that redirects writes to a logger instance
Class TopLevelFormatter Keep only top level loggers's name (direct children from root) from records.
Function configure_logging Initialize logging defaults for Scrapy.
Function failure_to_exc_info Extract exc_info from Failure instances
Function get_scrapy_root_handler Undocumented
Function install_scrapy_root_handler Undocumented
Function log_reactor_info Undocumented
Function log_scrapy_info Undocumented
Function logformatter_adapter Helper that takes the dictionary output from the methods in LogFormatter and adapts it into a tuple of positional arguments for logger.log calls, handling backward compatibility as well.
Constant DEFAULT_LOGGING Undocumented
Variable logger Undocumented
Function _get_handler Return a log handler object according to settings
Variable _scrapy_root_handler Undocumented
def configure_logging(settings=None, install_root_handler=True): (source)

Initialize logging defaults for Scrapy. :param settings: settings used to create and configure a handler for the root logger (default: None). :type settings: dict, :class:`~scrapy.settings.Settings` object or ``None`` :param install_root_handler: whether to install root logging handler (default: True) :type install_root_handler: bool This function does: - Route warnings and twisted logging through Python standard logging - Assign DEBUG and ERROR level to Scrapy and Twisted loggers respectively - Route stdout to log if LOG_STDOUT setting is True When ``install_root_handler`` is True (default), this function also creates a handler for the root logger according to given settings (see :ref:`topics-logging-settings`). You can override default options using ``settings`` argument. When ``settings`` is empty or None, defaults are used.

def failure_to_exc_info(failure): (source)

Extract exc_info from Failure instances

def get_scrapy_root_handler(): (source)

Undocumented

def install_scrapy_root_handler(settings): (source)

Undocumented

def log_reactor_info(): (source)

Undocumented

def log_scrapy_info(settings: Settings): (source)

Undocumented

def logformatter_adapter(logkws): (source)

Helper that takes the dictionary output from the methods in LogFormatter and adapts it into a tuple of positional arguments for logger.log calls, handling backward compatibility as well.

DEFAULT_LOGGING: dict = (source)

Undocumented

Value
{'version': 1,
 'disable_existing_loggers': False,
 'loggers': {'filelock': {'level': 'ERROR'},
             'hpack': {'level': 'ERROR'},
             'scrapy': {'level': 'DEBUG'},
             'twisted': {'level': 'ERROR'}}}

Undocumented

def _get_handler(settings): (source)

Return a log handler object according to settings

_scrapy_root_handler = (source)

Undocumented