-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MRG+2] [logformatter] 'flags' format spec backward compatibility #2649
Conversation
pass 'flags' kwarg to logger so that it is compatible with old format of CRAWLEDMSG.
0c5f9a6
to
0f2a5cd
Compare
scrapy/logformatter.py
Outdated
@@ -43,6 +43,7 @@ def crawled(self, request, response, spider): | |||
'request_flags' : request_flags, | |||
'referer': referer_str(request), | |||
'response_flags': response_flags, | |||
'flags': response_flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a comment which says that flags
alias is for backwards compatibility with Scrapy < 1.4?
tests/test_logformatter.py
Outdated
@@ -64,5 +64,32 @@ def test_scraped(self): | |||
assert all(isinstance(x, six.text_type) for x in lines) | |||
self.assertEqual(lines, [u"Scraped from <200 http://www.example.com>", u'name: \xa3']) | |||
|
|||
|
|||
class LogFormatterSubclass(LogFormatter): | |||
# Formatter with format spec that is same as in Scrapy before 1.3 version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think response.flags will be released as a part of 1.4, not 1.3.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments updated
Codecov Report
@@ Coverage Diff @@
## master #2649 +/- ##
==========================================
+ Coverage 84.25% 84.26% +0.01%
==========================================
Files 162 162
Lines 9106 9106
Branches 1350 1350
==========================================
+ Hits 7672 7673 +1
Misses 1174 1174
+ Partials 260 259 -1
Continue to review full report at Codecov.
|
Thanks @pawelmhm, looks good to me! |
pass 'flags' kwarg to logger so that it is compatible with old format of CRAWLEDMSG. fixes #2647