Skip to content

Logging


Scurrypy uses Python’s standard logging module.

Scurrypy does not configure logging by default. If you do not configure logging in your application, Scurrypy log messages will be discarded.

All loggers use the scurrypy namespace. Currently, logs are emitted from:

  • scurrypy.core.http
  • scurrypy.core.gateway
  • scurrypy.client

The following snippet can be used to enable logging with colored output:

import logging
from rich.logging import RichHandler

logger = logging.getLogger(__name__)

logging.basicConfig(
    level=logging.INFO,
    format="%(message)s",
    datefmt="[%X]",
    handlers=[RichHandler(show_path=False, rich_tracebacks=True)],
)

import scurrypy

# normal library usage