bitbake: server/process: Prefix the log data with pid/time information

Knowing which process printed which messages and the timestamp of the
message is useful for debugging, so add this. Ensure the log parsing
isn't affected by using search() instead of match().

(Bitbake rev: 1d043666710df1fa9d9586fd974c0371dd1514b0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2020-09-05 11:23:10 +01:00
parent f71587695c
commit 707f99642a

View File

@@ -36,7 +36,7 @@ class ProcessTimeout(SystemExit):
pass
def serverlog(msg):
print(msg)
print(str(os.getpid()) + " " + datetime.datetime.now().strftime('%H:%M:%S.%f') + " " + msg)
sys.stdout.flush()
class ProcessServer():
@@ -480,7 +480,7 @@ class BitBakeServer(object):
lines.append(line)
else:
lastlines.append(line)
res = logstart_re.match(line.rstrip())
res = logstart_re.search(line.rstrip())
if res:
ldatetime = datetime.datetime.strptime(res.group(2), start_log_datetime_format)
if ldatetime >= startdatetime: