Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit ad2ae67

Browse files
committed
Suppress most voluminous output from report() in quiet mode.
1 parent b3cf9cf commit ad2ae67

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/crawl.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,12 @@ def report(self, stats, file=None):
594594
stats.add('html')
595595
size = len(self.body or b'')
596596
stats.add('html_bytes', size)
597-
print(self.url, self.response.status,
598-
self.ctype, self.encoding,
599-
size,
600-
'%d/%d' % (len(self.new_urls or ()), len(self.urls or ())),
601-
file=file)
597+
if self.log.level:
598+
print(self.url, self.response.status,
599+
self.ctype, self.encoding,
600+
size,
601+
'%d/%d' % (len(self.new_urls or ()), len(self.urls or ())),
602+
file=file)
602603
elif self.response is None:
603604
print(self.url, 'no response object')
604605
else:

0 commit comments

Comments
 (0)