def METHOD_NAME(
    self, item: Any, response: Union[Response, Failure], spider: Spider
) -> dict:
    """Logs a message when an item is scraped by a spider."""
    src: Any
    if isinstance(response, Failure):
        src = response.getErrorMessage()
    else:
        src = response
    return {
        "level": logging.DEBUG,
        "msg": SCRAPEDMSG,
        "args": {
            "src": src,
            "item": item,
        },
    }