module documentation

Undocumented

Function configure​_logging Initialize logging defaults for Scrapy.
Constant DEFAULT​_LOGGING Undocumented
Variable logger Undocumented
Class ​Log​Counter​Handler Record log levels count into a crawler stats
Class ​Stream​Logger Fake file-like stream object that redirects writes to a logger instance
Class ​Top​Level​Formatter Keep only top level loggers's name (direct children from root) from records.
Function ​_get​_handler Return a log handler object according to settings
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​_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.
Variable ​_scrapy​_root​_handler Undocumented
def configure_logging(settings=None, install_root_handler=True):

Initialize logging defaults for Scrapy.

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.

Parameters
settings:dict, ~scrapy.settings.Settings object or Nonesettings used to create and configure a handler for the root logger (default: None).
install​_root​_handler:boolwhether to install root logging handler (default: True)
DEFAULT_LOGGING: dict =

Undocumented

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

Undocumented

def _get_handler(settings):
Return a log handler object according to settings
def failure_to_exc_info(failure):
Extract exc_info from Failure instances
def get_scrapy_root_handler():

Undocumented

def install_scrapy_root_handler(settings):

Undocumented

def log_scrapy_info(settings):

Undocumented

def logformatter_adapter(logkws):
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.
_scrapy_root_handler =

Undocumented