Parsing date from device log lines using regex to handle splitting on 1 or more spaces because date strings for days 1->9 look like "June 9 14:30:43" and splitting on single space was incorrect.

This commit is contained in:
Curtis Siemens
2014-06-05 15:01:24 -07:00
parent 507611f06f
commit 0acf6fabe2
+1 -1
View File
@@ -152,7 +152,7 @@ IosLog.prototype.onOutput = function (data, prefix) {
// logRowDate.isAfter(this.iosLogStartTime) check so we require a state flag here,
// otherwise all the lines without dates get filtered out even if they are new.
if (!this.loggingModeOn) {
var logRowParts = log.split(" ");
var logRowParts = log.split(/\s+/);
var logRowDate = new Date(
Date.parse(this.iosLogStartTime.getFullYear() + " " + logRowParts[0] + " " + logRowParts[1] + " " + logRowParts[2])
);