Skip to main content

Color log output support for Scrapy

Project description

scrapy-colorlog

Color log output support for Scrapy.

Installation

pip install scrapy-colorlog

Configuration

Add the following to your Scrapy project settings module:

import scrapy_colorlog

scrapy_colorlog.install()

Settings

COLORLOG_FORMAT

Default:

(
    "%(light_black)s%(asctime)s%(reset)s "
    "%(light_black)s[%(name)s]%(reset)s "
    "%(log_color)s%(levelname)s%(reset)s%(light_black)s:%(reset)s "
    "%(message)s"
)

String for formatting log messages. Refer to the colorlog package documentation for available escape codes and parameters to the format string.

See also: LOG_FORMAT.

COLORLOG_DATEFORMAT

Default: "%Y-%m-%d %H:%M:%S"

String for formatting date/time, expansion of the %(asctime)s placeholder in COLORLOG_FORMAT.

See also: LOG_DATEFORMAT.

COLORLOG_COLORS

Default:

{
    "DEBUG": "blue",
    "INFO": "cyan",
    "WARNING": "yellow",
    "ERROR": "red",
    "CRITICAL": "purple",
}

A mapping of record level names to color names. Refer to the colorlog package documentation for details.

COLORLOG_SECONDARY_COLORS

Default: None

A mapping of names to log_colors style mappings, defining additional colors that can be used in format strings. Refer to the colorlog package documentation for details.

COLORLOG_RESET

Default: True

Implicitly adds a color reset code to the message output, unless the output already ends with one.

COLORLOG_NO_COLOR

Default: False

Disable color output.

See also: NO_COLOR environment variable.

COLORLOG_FORCE_COLOR

Default: False

Enable color output. Takes precedence over COLORLOG_NO_COLOR.

See also: FORCE_COLOR environment variable.

Environment variables

NO_COLOR

Disable color output. See NO_COLOR for details.

FORCE_COLOR

Enable color output. Takes precedence over NO_COLOR.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrapy_colorlog-0.1.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrapy_colorlog-0.1.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file scrapy_colorlog-0.1.1.tar.gz.

File metadata

  • Download URL: scrapy_colorlog-0.1.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.13.3 CPython/3.12.0 Windows/11

File hashes

Hashes for scrapy_colorlog-0.1.1.tar.gz
Algorithm Hash digest
SHA256 147d6dfe2c5dcb0dfe9b71af1c47fec15551adc1843941dba233d65f9f410846
MD5 eecc9c573317106e0fbaa4365f5f017f
BLAKE2b-256 4d22c44c15477dd0b7b655298c6581b8e1cdc5f6a4237ba438bec79b0a85e836

See more details on using hashes here.

File details

Details for the file scrapy_colorlog-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: scrapy_colorlog-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.13.3 CPython/3.12.0 Windows/11

File hashes

Hashes for scrapy_colorlog-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8ca2896449b5cadf1c1b8332d8ffcf3f3ecd27f0d97d1c1a6762e72bb229e27
MD5 d57458469490d5a43c9a91c60a0157eb
BLAKE2b-256 b7f34fe0222bc1ab9520fd44bb2023adf3f46ebc5e1dd182d4c5535a3710738d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page