Changes:
- Each module takes 'scrapy' logger and logs through it
- Lazy string evaluation in all log messages
- Added missing log messages in scrapy/core/engine.py
- Contextual data such as crawler or spider instances, and failures
This change removes singletons for stats collection and signal
dispatching facilities, by making them a member of the Crawler class.
Here are some examples to illustrates the old and new API:
Signals - before:
from scrapy import signals
from scrapy.xlib.pydispatch import dispatcher
dispatcher.connect(self.spider_opened, signals.spider_opened)
Signals - now:
from scrapy import signals
crawler.signals.connect(self.spider.opened, signals.spider_opened)
Stats collection - before:
from scrapy.stats import stats
stats.inc_value('foo')
Stats collection - now:
crawler.stats.inc_value('foo')
Backwards compatibility was retained as much as possible and the old API
has been properly flagged with deprecation warnings.
* moved scrapy.stats.collector.__init__ module to scrapy.statscol
* moved scrapy.stats.collector.simpledb module to scrapy.contrib.statscol
* moved signals from scrapy.stats.signals to scrapy.signals
* moved scrapy/stats/__init__.py to scrapy/stats.py
* updated documentation and tests accordingly
--HG--
rename : scrapy/stats/collector/simpledb.py => scrapy/contrib/statscol.py
rename : scrapy/stats/__init__.py => scrapy/stats.py
rename : scrapy/stats/collector/__init__.py => scrapy/statscol.py