Skip to main content

CrawleeLogFormatter

crawlee._log_config.CrawleeLogFormatter

Log formatter that prints out the log message nicely formatted, with colored level and stringified extra fields.

It formats the log records so that they: - start with the level (colorized, and padded to 5 chars so that it is nicely aligned) - then have the actual log message, if it's multiline then it's nicely indented - then have the stringified extra log fields - then, if an exception is a part of the log record, prints the formatted exception.

Index

Constructors

Methods

Properties

Constructors

__init__

  • __init__(include_logger_name, args, kwargs): None
  • Create a new instance.


    Parameters

    • include_logger_name: bool = True
    • args: Any
    • kwargs: Any

    Returns None

Methods

format

  • format(record): str
  • Format the log record nicely.

    This formats the log record so that it: - starts with the level (colorized, and padded to 5 chars so that it is nicely aligned) - then has the actual log message, if it's multiline then it's nicely indented - then has the stringified extra log fields - then, if an exception is a part of the log record, prints the formatted exception.


    Parameters

    • record: logging.LogRecord

    Returns str

Properties

empty_record

empty_record: