mirror of https://github.com/scrapy/scrapy.git
scrapy.service: fixed minor logging bug on win32 platform with different line endings
This commit is contained in:
parent
a8b80f3e2f
commit
d76276408e
|
|
@ -75,13 +75,14 @@ class ScrapyProcessProtocol(protocol.ProcessProtocol):
|
|||
self.deferred.callback(self)
|
||||
|
||||
def _log_ended(self, msg):
|
||||
tolog = [msg]
|
||||
if self.outdata:
|
||||
msg += "\n>>> stdout (last %d lines) <<<\n%s" % (self.TAIL_LINES, \
|
||||
self.outdata)
|
||||
tolog += [">>> stdout (last %d lines) <<<" % self.TAIL_LINES]
|
||||
tolog += [self.outdata]
|
||||
if self.errdata:
|
||||
msg += "\n>>> stderr (last %d lines) <<<\n%s" % (self.TAIL_LINES, \
|
||||
self.errdata)
|
||||
log.msg(msg)
|
||||
tolog += [">>> stderr (last %d lines) <<<" % self.TAIL_LINES]
|
||||
tolog += [self.errdata]
|
||||
log.msg(os.linesep.join(tolog))
|
||||
|
||||
def _tail(self, data, lines=TAIL_LINES):
|
||||
return os.linesep.join(data.splitlines()[-lines:])
|
||||
return os.linesep.join(data.split(os.linesep)[-lines:])
|
||||
|
|
|
|||
Loading…
Reference in New Issue