From 65c7428a7fe33ab3d8956f5ff594e70e57deac23 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 12 Oct 2018 14:35:05 -0400 Subject: [PATCH] comment out log code for now --- lib/core/logger.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/core/logger.js b/lib/core/logger.js index 85676bdbb..8f45c6a06 100644 --- a/lib/core/logger.js +++ b/lib/core/logger.js @@ -4,7 +4,7 @@ const date = require('date-and-time'); const constants = require('../constants'); const DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss:SSS'; -const LOG_REGEX = /\[(?\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d:\d\d\d)\] (?:\[(?\w*)\]:?)?\s?\s?(?.*)/gmi; +// const LOG_REGEX = /\[(?\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d:\d\d\d)\] (?:\[(?\w*)\]:?)?\s?\s?(?.*)/gmi; class Logger { constructor(options) { @@ -38,21 +38,21 @@ class Logger { let matches; let logs = []; const logFile = fs.readFileSync(this.logFile, 'utf8'); - while ((matches = LOG_REGEX.exec(logFile)) !== null) { - // This is necessary to avoid infinite loops with zero-width matches - if (matches.index === LOG_REGEX.lastIndex) { - LOG_REGEX.lastIndex++; - } + //while ((matches = LOG_REGEX.exec(logFile)) !== null) { + // // This is necessary to avoid infinite loops with zero-width matches + // if (matches.index === LOG_REGEX.lastIndex) { + // LOG_REGEX.lastIndex++; + // } - if (matches && matches.groups) { - logs.push({ - msg: [matches.groups.msg], - logLevel: matches.groups.logLevel, - name: 'embark', - timestamp: date.parse(matches.groups.date, DATE_FORMAT).getTime() - }); - } - } + // if (matches && matches.groups) { + // logs.push({ + // msg: [matches.groups.msg], + // logLevel: matches.groups.logLevel, + // name: 'embark', + // timestamp: date.parse(matches.groups.date, DATE_FORMAT).getTime() + // }); + // } + //} // if 'limit' is specified, get log lines from the end of the log file if(limit && limit > 0 && logs.length > limit){