Skip to content

Commit

Permalink
feat: don't record debug log to local log file.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpselvis committed Feb 6, 2018
1 parent a6b185d commit 7b0859d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/core/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ ConsoleStream.prototype._write = function (data, enc, callback) {
} else {
process.stdout.write(msg);
}

const logDir = pathFn.join(osenv.home(), './.feflow/logs');
const today = formatDate('yyyy-MM-dd', new Date());
const logPath = pathFn.join(logDir, `${today}.log`);
fs.appendFileSync(logPath, msg);

if (!this.debug) {
const logDir = pathFn.join(osenv.home(), './.feflow/logs');
const today = formatDate('yyyy-MM-dd', new Date());
const logPath = pathFn.join(logDir, `${today}.log`);
fs.appendFileSync(logPath, msg);
}

callback();
};
Expand Down

0 comments on commit 7b0859d

Please sign in to comment.