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