Make console log output use deliminator
Make the console log look more like the old Jenkins output so that log
parsing scripts, etc, don't have to be modified.
We have, however, retained the higher precsion timestamp.
I922283891c557e489e4d75f17e78e8c31a5ca2ca tests that os-loganalyze can
handle the higher precision timestamp; logstash's built-in
TIMESTAMP_ISO8601 regex will also parse it (see
I16d3215c94f0cd5698fc23b1f1bf6252d9157246).
Change-Id: Ia5356f867d52a2758aa179f5454cbe196bbf98a2
diff --git a/zuul/ansible/library/zuul_runner.py b/zuul/ansible/library/zuul_runner.py
index 5a38807..7689fb3 100644
--- a/zuul/ansible/library/zuul_runner.py
+++ b/zuul/ansible/library/zuul_runner.py
@@ -31,8 +31,12 @@
self.logfile.close()
def addLine(self, ln):
+ # Note this format with deliminator is "inspired" by the old
+ # Jenkins format but with microsecond resolution instead of
+ # millisecond. It is kept so log parsing/formatting remains
+ # consistent.
ts = datetime.datetime.now()
- outln = '%s %s' % (str(ts), ln)
+ outln = '%s | %s' % (ts, ln)
self.logfile.write(outln)