diff options
| -rw-r--r-- | bitbake/lib/bb/server/process.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index d12b06ff08..070da4fe7a 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
| @@ -414,22 +414,28 @@ class BitBakeServer(object): | |||
| 414 | logstart_re = re.compile(self.start_log_format % ('([0-9]+)', '([0-9-]+ [0-9:.]+)')) | 414 | logstart_re = re.compile(self.start_log_format % ('([0-9]+)', '([0-9-]+ [0-9:.]+)')) |
| 415 | started = False | 415 | started = False |
| 416 | lines = [] | 416 | lines = [] |
| 417 | lastlines = [] | ||
| 417 | with open(logfile, "r") as f: | 418 | with open(logfile, "r") as f: |
| 418 | for line in f: | 419 | for line in f: |
| 419 | if started: | 420 | if started: |
| 420 | lines.append(line) | 421 | lines.append(line) |
| 421 | else: | 422 | else: |
| 423 | lastlines.append(line) | ||
| 422 | res = logstart_re.match(line.rstrip()) | 424 | res = logstart_re.match(line.rstrip()) |
| 423 | if res: | 425 | if res: |
| 424 | ldatetime = datetime.datetime.strptime(res.group(2), self.start_log_datetime_format) | 426 | ldatetime = datetime.datetime.strptime(res.group(2), self.start_log_datetime_format) |
| 425 | if ldatetime >= startdatetime: | 427 | if ldatetime >= startdatetime: |
| 426 | started = True | 428 | started = True |
| 427 | lines.append(line) | 429 | lines.append(line) |
| 430 | if len(lastlines) > 60: | ||
| 431 | lastlines = lastlines[-60:] | ||
| 428 | if lines: | 432 | if lines: |
| 429 | if len(lines) > 60: | 433 | if len(lines) > 60: |
| 430 | bb.error("Last 60 lines of server log for this session (%s):\n%s" % (logfile, "".join(lines[-60:]))) | 434 | bb.error("Last 60 lines of server log for this session (%s):\n%s" % (logfile, "".join(lines[-60:]))) |
| 431 | else: | 435 | else: |
| 432 | bb.error("Server log for this session (%s):\n%s" % (logfile, "".join(lines))) | 436 | bb.error("Server log for this session (%s):\n%s" % (logfile, "".join(lines))) |
| 437 | elif lastlines: | ||
| 438 | bb.error("Server didn't start, last 60 loglines (%s):\n%s" % (logfile, "".join(lastlines))) | ||
| 433 | else: | 439 | else: |
| 434 | bb.error("%s doesn't exist" % logfile) | 440 | bb.error("%s doesn't exist" % logfile) |
| 435 | 441 | ||
