mirror of https://github.com/scrapy/scrapy.git
Merge pull request #2239 from redapple/streamlogger-flush
[MRG+1] Add flush() method to StreamLogger
This commit is contained in:
commit
490f6e08f3
|
|
@ -145,6 +145,10 @@ class StreamLogger(object):
|
|||
for line in buf.rstrip().splitlines():
|
||||
self.logger.log(self.log_level, line.rstrip())
|
||||
|
||||
def flush(self):
|
||||
for h in self.logger.handlers:
|
||||
h.flush()
|
||||
|
||||
|
||||
class LogCounterHandler(logging.Handler):
|
||||
"""Record log levels count into a crawler stats"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue