mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-25 09:43:46 +00:00
Change 'scrapy' logger for '__name__' on every module
This commit is contained in:
parent
69a3d58110
commit
4f54ca3294
@ -11,7 +11,7 @@ from scrapy.utils.conf import arglist_to_dict
|
|||||||
from scrapy.utils.spider import iterate_spider_output, spidercls_for_request
|
from scrapy.utils.spider import iterate_spider_output, spidercls_for_request
|
||||||
from scrapy.exceptions import UsageError
|
from scrapy.exceptions import UsageError
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Command(ScrapyCommand):
|
class Command(ScrapyCommand):
|
||||||
|
@ -14,7 +14,7 @@ from pdb import Pdb
|
|||||||
from scrapy.utils.engine import format_engine_status
|
from scrapy.utils.engine import format_engine_status
|
||||||
from scrapy.utils.trackref import format_live_refs
|
from scrapy.utils.trackref import format_live_refs
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class StackTraceDump(object):
|
class StackTraceDump(object):
|
||||||
|
@ -11,7 +11,7 @@ from scrapy.http import HtmlResponse
|
|||||||
from scrapy.utils.response import _noscript_re, _script_re
|
from scrapy.utils.response import _noscript_re, _script_re
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class AjaxCrawlMiddleware(object):
|
class AjaxCrawlMiddleware(object):
|
||||||
|
@ -7,7 +7,7 @@ from scrapy.exceptions import NotConfigured
|
|||||||
from scrapy.http import Response
|
from scrapy.http import Response
|
||||||
from scrapy.http.cookies import CookieJar
|
from scrapy.http.cookies import CookieJar
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class CookiesMiddleware(object):
|
class CookiesMiddleware(object):
|
||||||
|
@ -18,7 +18,7 @@ except ImportError:
|
|||||||
|
|
||||||
from scrapy.responsetypes import responsetypes
|
from scrapy.responsetypes import responsetypes
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DecompressionMiddleware(object):
|
class DecompressionMiddleware(object):
|
||||||
|
@ -5,7 +5,7 @@ from scrapy.http import HtmlResponse
|
|||||||
from scrapy.utils.response import get_meta_refresh
|
from scrapy.utils.response import get_meta_refresh
|
||||||
from scrapy.exceptions import IgnoreRequest, NotConfigured
|
from scrapy.exceptions import IgnoreRequest, NotConfigured
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class BaseRedirectMiddleware(object):
|
class BaseRedirectMiddleware(object):
|
||||||
|
@ -28,7 +28,7 @@ from scrapy.exceptions import NotConfigured
|
|||||||
from scrapy.utils.response import response_status_message
|
from scrapy.utils.response import response_status_message
|
||||||
from scrapy.xlib.tx import ResponseFailed
|
from scrapy.xlib.tx import ResponseFailed
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class RetryMiddleware(object):
|
class RetryMiddleware(object):
|
||||||
|
@ -12,7 +12,7 @@ from scrapy.exceptions import NotConfigured, IgnoreRequest
|
|||||||
from scrapy.http import Request
|
from scrapy.http import Request
|
||||||
from scrapy.utils.httpobj import urlparse_cached
|
from scrapy.utils.httpobj import urlparse_cached
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class RobotsTxtMiddleware(object):
|
class RobotsTxtMiddleware(object):
|
||||||
|
@ -23,7 +23,7 @@ from scrapy.exceptions import NotConfigured
|
|||||||
from scrapy.utils.misc import load_object
|
from scrapy.utils.misc import load_object
|
||||||
from scrapy.utils.python import get_func_args
|
from scrapy.utils.python import get_func_args
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class IFeedStorage(Interface):
|
class IFeedStorage(Interface):
|
||||||
|
@ -5,7 +5,7 @@ from twisted.internet import task
|
|||||||
from scrapy.exceptions import NotConfigured
|
from scrapy.exceptions import NotConfigured
|
||||||
from scrapy import signals
|
from scrapy import signals
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class LogStats(object):
|
class LogStats(object):
|
||||||
|
@ -16,7 +16,7 @@ from scrapy.exceptions import NotConfigured
|
|||||||
from scrapy.mail import MailSender
|
from scrapy.mail import MailSender
|
||||||
from scrapy.utils.engine import get_engine_status
|
from scrapy.utils.engine import get_engine_status
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class MemoryUsage(object):
|
class MemoryUsage(object):
|
||||||
|
@ -26,7 +26,7 @@ from scrapy.exceptions import NotConfigured, IgnoreRequest
|
|||||||
from scrapy.http import Request
|
from scrapy.http import Request
|
||||||
from scrapy.utils.misc import md5sum
|
from scrapy.utils.misc import md5sum
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class FileException(Exception):
|
class FileException(Exception):
|
||||||
|
@ -9,7 +9,7 @@ from scrapy.utils.defer import mustbe_deferred, defer_result
|
|||||||
from scrapy.utils.request import request_fingerprint
|
from scrapy.utils.request import request_fingerprint
|
||||||
from scrapy.utils.misc import arg_to_iter
|
from scrapy.utils.misc import arg_to_iter
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class MediaPipeline(object):
|
class MediaPipeline(object):
|
||||||
|
@ -8,7 +8,7 @@ import logging
|
|||||||
|
|
||||||
from scrapy.http import Request
|
from scrapy.http import Request
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DepthMiddleware(object):
|
class DepthMiddleware(object):
|
||||||
|
@ -7,7 +7,7 @@ import logging
|
|||||||
|
|
||||||
from scrapy.exceptions import IgnoreRequest
|
from scrapy.exceptions import IgnoreRequest
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class HttpError(IgnoreRequest):
|
class HttpError(IgnoreRequest):
|
||||||
|
@ -11,7 +11,7 @@ from scrapy import signals
|
|||||||
from scrapy.http import Request
|
from scrapy.http import Request
|
||||||
from scrapy.utils.httpobj import urlparse_cached
|
from scrapy.utils.httpobj import urlparse_cached
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class OffsiteMiddleware(object):
|
class OffsiteMiddleware(object):
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import logging
|
|||||||
from scrapy.http import Request
|
from scrapy.http import Request
|
||||||
from scrapy.exceptions import NotConfigured
|
from scrapy.exceptions import NotConfigured
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class UrlLengthMiddleware(object):
|
class UrlLengthMiddleware(object):
|
||||||
|
@ -6,7 +6,7 @@ from scrapy.http import Request, XmlResponse
|
|||||||
from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robots
|
from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robots
|
||||||
from scrapy.utils.gz import gunzip, is_gzipped
|
from scrapy.utils.gz import gunzip, is_gzipped
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SitemapSpider(Spider):
|
class SitemapSpider(Spider):
|
||||||
|
@ -3,7 +3,7 @@ import logging
|
|||||||
from scrapy.exceptions import NotConfigured
|
from scrapy.exceptions import NotConfigured
|
||||||
from scrapy import signals
|
from scrapy import signals
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class AutoThrottle(object):
|
class AutoThrottle(object):
|
||||||
|
@ -21,7 +21,7 @@ from scrapy.core.downloader.webclient import _parse
|
|||||||
from scrapy.utils.misc import load_object
|
from scrapy.utils.misc import load_object
|
||||||
from scrapy import twisted_version
|
from scrapy import twisted_version
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class HTTP11DownloadHandler(object):
|
class HTTP11DownloadHandler(object):
|
||||||
|
@ -17,7 +17,7 @@ from scrapy.http import Response, Request
|
|||||||
from scrapy.utils.misc import load_object
|
from scrapy.utils.misc import load_object
|
||||||
from scrapy.utils.reactor import CallLaterOnce
|
from scrapy.utils.reactor import CallLaterOnce
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Slot(object):
|
class Slot(object):
|
||||||
|
@ -8,7 +8,7 @@ from scrapy.utils.reqser import request_to_dict, request_from_dict
|
|||||||
from scrapy.utils.misc import load_object
|
from scrapy.utils.misc import load_object
|
||||||
from scrapy.utils.job import job_dir
|
from scrapy.utils.job import job_dir
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Scheduler(object):
|
class Scheduler(object):
|
||||||
|
@ -16,7 +16,7 @@ from scrapy.http import Request, Response
|
|||||||
from scrapy.item import BaseItem
|
from scrapy.item import BaseItem
|
||||||
from scrapy.core.spidermw import SpiderMiddlewareManager
|
from scrapy.core.spidermw import SpiderMiddlewareManager
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Slot(object):
|
class Slot(object):
|
||||||
|
@ -18,7 +18,7 @@ from scrapy.utils.misc import load_object
|
|||||||
from scrapy.utils.log import LogCounterHandler, configure_logging, log_scrapy_info
|
from scrapy.utils.log import LogCounterHandler, configure_logging, log_scrapy_info
|
||||||
from scrapy import signals
|
from scrapy import signals
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Crawler(object):
|
class Crawler(object):
|
||||||
|
@ -33,7 +33,7 @@ class RFPDupeFilter(BaseDupeFilter):
|
|||||||
self.fingerprints = set()
|
self.fingerprints = set()
|
||||||
self.logdupes = True
|
self.logdupes = True
|
||||||
self.debug = debug
|
self.debug = debug
|
||||||
self.logger = logging.getLogger('scrapy')
|
self.logger = logging.getLogger(__name__)
|
||||||
if path:
|
if path:
|
||||||
self.file = open(os.path.join(path, 'requests.seen'), 'a+')
|
self.file = open(os.path.join(path, 'requests.seen'), 'a+')
|
||||||
self.fingerprints.update(x.rstrip() for x in self.file)
|
self.fingerprints.update(x.rstrip() for x in self.file)
|
||||||
|
@ -9,7 +9,7 @@ from twisted.python.failure import Failure
|
|||||||
|
|
||||||
from scrapy.exceptions import ScrapyDeprecationWarning
|
from scrapy.exceptions import ScrapyDeprecationWarning
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
warnings.warn("Module `scrapy.log` has been deprecated, Scrapy now relies on "
|
warnings.warn("Module `scrapy.log` has been deprecated, Scrapy now relies on "
|
||||||
"the builtin Python library for logging. Read the updated "
|
"the builtin Python library for logging. Read the updated "
|
||||||
|
@ -22,7 +22,7 @@ else:
|
|||||||
from twisted.internet import defer, reactor, ssl
|
from twisted.internet import defer, reactor, ssl
|
||||||
from twisted.mail.smtp import ESMTPSenderFactory
|
from twisted.mail.smtp import ESMTPSenderFactory
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class MailSender(object):
|
class MailSender(object):
|
||||||
|
@ -5,7 +5,7 @@ from scrapy.exceptions import NotConfigured
|
|||||||
from scrapy.utils.misc import load_object
|
from scrapy.utils.misc import load_object
|
||||||
from scrapy.utils.defer import process_parallel, process_chain, process_chain_both
|
from scrapy.utils.defer import process_parallel, process_chain, process_chain_both
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class MiddlewareManager(object):
|
class MiddlewareManager(object):
|
||||||
|
@ -4,7 +4,7 @@ Scrapy extension for collecting scraping stats
|
|||||||
import pprint
|
import pprint
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class StatsCollector(object):
|
class StatsCollector(object):
|
||||||
|
@ -27,7 +27,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
hpy = None
|
hpy = None
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# signal to update telnet variables
|
# signal to update telnet variables
|
||||||
# args: telnet_vars
|
# args: telnet_vars
|
||||||
|
@ -13,7 +13,7 @@ from scrapy.http import TextResponse, Response
|
|||||||
from scrapy.selector import Selector
|
from scrapy.selector import Selector
|
||||||
from scrapy.utils.python import re_rsearch, str_to_unicode
|
from scrapy.utils.python import re_rsearch, str_to_unicode
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def xmliter(obj, nodename):
|
def xmliter(obj, nodename):
|
||||||
|
@ -11,7 +11,7 @@ from twisted.python import log as twisted_log
|
|||||||
import scrapy
|
import scrapy
|
||||||
from scrapy.settings import overridden_settings
|
from scrapy.settings import overridden_settings
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class FailureFormatter(logging.Filter):
|
class FailureFormatter(logging.Filter):
|
||||||
|
@ -9,7 +9,7 @@ from scrapy.xlib.pydispatch.dispatcher import Any, Anonymous, liveReceivers, \
|
|||||||
getAllReceivers, disconnect
|
getAllReceivers, disconnect
|
||||||
from scrapy.xlib.pydispatch.robustapply import robustApply
|
from scrapy.xlib.pydispatch.robustapply import robustApply
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def send_catch_log(signal=Any, sender=Anonymous, *arguments, **named):
|
def send_catch_log(signal=Any, sender=Anonymous, *arguments, **named):
|
||||||
|
@ -6,7 +6,7 @@ import six
|
|||||||
from scrapy.spider import Spider
|
from scrapy.spider import Spider
|
||||||
from scrapy.utils.misc import arg_to_iter
|
from scrapy.utils.misc import arg_to_iter
|
||||||
|
|
||||||
logger = logging.getLogger('scrapy')
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def iterate_spider_output(result):
|
def iterate_spider_output(result):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user