[oe-commits] [bitbake] 06/06: server/process: Show last 60 lines of the log if the server didn't start

git at git.openembedded.org git at git.openembedded.org
Tue Jan 8 20:19:49 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch 1.40
in repository bitbake.

commit 1351978585b76262cb104f3d609d79c184ee5d2b
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Tue Nov 27 11:31:21 2018 +0000

    server/process: Show last 60 lines of the log if the server didn't start
    
    We're seeing issues where the server doesn't start with no logs as to why. Allow
    the server to print the last 60 log lines just in case this shows us something useful
    about what is failing.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/server/process.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index d12b06f..070da4f 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -414,22 +414,28 @@ class BitBakeServer(object):
                 logstart_re = re.compile(self.start_log_format % ('([0-9]+)', '([0-9-]+ [0-9:.]+)'))
                 started = False
                 lines = []
+                lastlines = []
                 with open(logfile, "r") as f:
                     for line in f:
                         if started:
                             lines.append(line)
                         else:
+                            lastlines.append(line)
                             res = logstart_re.match(line.rstrip())
                             if res:
                                 ldatetime = datetime.datetime.strptime(res.group(2), self.start_log_datetime_format)
                                 if ldatetime >= startdatetime:
                                     started = True
                                     lines.append(line)
+                        if len(lastlines) > 60:
+                            lastlines = lastlines[-60:]
                 if lines:
                     if len(lines) > 60:
                         bb.error("Last 60 lines of server log for this session (%s):\n%s" % (logfile, "".join(lines[-60:])))
                     else:
                         bb.error("Server log for this session (%s):\n%s" % (logfile, "".join(lines)))
+                elif lastlines:
+                        bb.error("Server didn't start, last 60 loglines (%s):\n%s" % (logfile, "".join(lastlines)))
             else:
                 bb.error("%s doesn't exist" % logfile)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list