From 4811d16f1d1bd2b34ef1838428e340342fdfd113 Mon Sep 17 00:00:00 2001 From: Julia Medina Date: Tue, 10 Mar 2015 15:53:38 -0300 Subject: [PATCH] Update `logger` attr and `log` method in the Spiders topic on docs --- docs/topics/spiders.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst index ddeb17d07..c64e98396 100644 --- a/docs/topics/spiders.rst +++ b/docs/topics/spiders.rst @@ -112,6 +112,12 @@ scrapy.Spider :class:`~scrapy.settings.Settings` instance, see the :ref:`topics-settings` topic for a detailed introduction on this subject. + .. attribute:: logger + + Python logger created with the Spider's :attr:`name`. You can use it to + send log messages through it as described on + :ref:`topics-logging-from-spiders`. + .. method:: from_crawler(crawler, \*args, \**kwargs) This is the class method used by Scrapy to create your spiders. @@ -194,9 +200,9 @@ scrapy.Spider .. method:: log(message, [level, component]) - Log a message using the :func:`scrapy.log.msg` function, automatically - populating the spider argument with the :attr:`name` of this - spider. For more information see :ref:`topics-logging`. + Wrapper that sends a log message through the Spider's :attr:`logger`, + kept for backwards compatibility. For more information see + :ref:`topics-logging-from-spiders`. .. method:: closed(reason)