Ignore faulty empty log lines

This commit is contained in:
Johannes Zellner
2018-06-14 12:21:43 +02:00
parent eaf0b4e56e
commit cdc78936b5

View File

@@ -838,10 +838,14 @@ function getLogs(appId, options, callback) {
var data = line.split(' '); // logs are <ISOtimestamp> <msg>
var timestamp = (new Date(data[0])).getTime();
if (isNaN(timestamp)) timestamp = 0;
var message = line.slice(data[0].length+1);
// ignore faulty empty logs
if (!timestamp && !message) return;
return JSON.stringify({
realtimeTimestamp: timestamp * 1000,
message: line.slice(data[0].length+1),
message: message,
source: appId
}) + '\n';
});