提交 96bb223c 编写于 作者: P Pablo Hoffman

removed (pretty useless) DebugMiddleware

上级 86de5180
......@@ -153,20 +153,6 @@ DefaultHeadersMiddleware
This middleware sets all default requests headers specified in the
:setting:`DEFAULT_REQUEST_HEADERS` setting.
DebugMiddleware
---------------
.. module:: scrapy.contrib.downloadermiddleware.debug
:synopsis: Downloader middlewares for debugging
.. class:: DebugMiddleware
This is a convenient middleware to inspect what's passing through the
downloader middleware. It logs all requests and responses catched by the
middleware component methods. This middleware does not use any settings and
does not come enabled by default. Instead, it's meant to be inserted at the
point of the middleware that you want to inspect.
HttpAuthMiddleware
------------------
......
from scrapy import log
from scrapy.core.exceptions import NotConfigured
class DebugMiddleware(object):
def process_request(self, request, spider):
log.msg("process_request %r" % request, domain=spider.domain_name, level=log.DEBUG)
def process_exception(self, request, exception, spider):
log.msg("process_exception %s in %r" % (exception, request), domain=spider.domain_name, level=log.DEBUG)
def process_response(self, request, response, spider):
log.msg("process_response %s from %r" % (response, request), domain=spider.domain_name, level=log.DEBUG)
return response
# FIXME: backwards compatibility - will be removed before 0.7 release
import warnings
class CrawlDebug(object):
def __init__(self):
warnings.warn("scrapy.contrib.downloadermiddleware.debug.CrawlDebug has been replaced by scrapy.contrib.downloadermiddleware.debug.DebugDownloaderMiddleware")
DebugMiddleware.__init__(self)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册