From 707f99642a6f29f2db835aadb8afba672e265588 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 5 Sep 2020 11:23:10 +0100 Subject: 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 --- bitbake/lib/bb/server/process.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb/server') diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index 83c3e6b444..21f95cb61e 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py @@ -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: -- cgit v1.2.3-54-g00ecf