Deliver the correct utc timestamp instead of the ISO string

This commit is contained in:
Johannes Zellner
2018-06-04 21:34:05 +02:00
parent 36aaa0406e
commit fd0e2782d8
+5 -6
View File
@@ -827,14 +827,13 @@ function getLogs(appId, options, callback) {
var transformStream = split(function mapper(line) {
if (format !== 'json') return line + '\n';
var obj = safe.JSON.parse(line);
if (!obj) return undefined;
var data = line.split(' '); // logs are <ISOtimestamp> <msg>
var timestamp = (new Date(data[0])).getTime();
if (isNaN(timestamp)) timestamp = 0;
return JSON.stringify({
realtimeTimestamp: data[0],
monotonicTimestamp: data[0],
message: data[1],
realtimeTimestamp: timestamp * 1000,
message: line.slice(data[0].length+1),
source: appId
}) + '\n';
});