Run beautify and update for python3
This wasn't working with latest python due to
invalid tabs and the print statements not having ()
Change-Id: I59c9af03ed79adc7eb00149e9a0f8f0d41370fe9
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/post-process/pretty-journal.py b/post-process/pretty-journal.py
index c4008f1..4014f8d 100644
--- a/post-process/pretty-journal.py
+++ b/post-process/pretty-journal.py
@@ -11,15 +11,17 @@
import time
from argparse import ArgumentParser
+
def jpretty_to_python(buf):
entries = []
for entry in re.findall(
'^{$(.+?)^}$', buf, re.DOTALL | re.MULTILINE):
- entries += [ json.loads('{{{}}}'.format(entry)) ]
+ entries += [json.loads('{{{}}}'.format(entry))]
return entries
+
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument(
@@ -32,10 +34,10 @@
entries = sorted(entries, key=lambda k: k['__REALTIME_TIMESTAMP'])
for e in entries:
- e['ts'] = time.ctime(float(e['__REALTIME_TIMESTAMP'])/1000000).rstrip()
- try:
- print '{ts} {_HOSTNAME} {SYSLOG_IDENTIFIER}: {MESSAGE}'.format(**e)
- except:
- print "Unable to parse msg: " + str(e)
- continue
-
+ e['ts'] = time.ctime(
+ float(e['__REALTIME_TIMESTAMP']) / 1000000).rstrip()
+ try:
+ print ('{ts} {_HOSTNAME} {SYSLOG_IDENTIFIER}: {MESSAGE}'.format(**e))
+ except:
+ print ("Unable to parse msg: " + str(e))
+ continue