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