Commit 3175e9c6 authored by Kirill Smelkov's avatar Kirill Smelkov

amari.xlog: Switch time emitted in events to be seconds/epoch instead of RFC822

The time emitted in messages by Amarisoft is in seconds. It also makes
sense to emit meta/event times in seconds as well for uniformity.

This is backward-incompatible change, but it should be ok at this early time.
parent 9c8da27f
...@@ -34,7 +34,6 @@ from xlte import amari ...@@ -34,7 +34,6 @@ from xlte import amari
import json import json
import traceback import traceback
from email.utils import formatdate
from golang import func, defer from golang import func, defer
from golang import time from golang import time
from golang.gcompat import qq from golang.gcompat import qq
...@@ -130,7 +129,7 @@ class _XLogger: ...@@ -130,7 +129,7 @@ class _XLogger:
# jemit emits line corresponding to event to the log. # jemit emits line corresponding to event to the log.
def jemit(xl, event, args_dict): def jemit(xl, event, args_dict):
d = {"event": event, "time": formatdate(time.now())} # RFC 822 / UTC d = {"event": event, "time": time.now()} # seconds since epoch
d.update(args_dict) d.update(args_dict)
d = {"meta": d} d = {"meta": d}
xl.emit(json.dumps(d)) xl.emit(json.dumps(d))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment