forked from mirrors/Scribe.js
Only get rootPath if no LogWriter instances given
This commit is contained in:
parent
4c17b1badf
commit
c9c797e556
1 changed files with 10 additions and 12 deletions
22
scribe.js
22
scribe.js
|
@ -7,13 +7,6 @@
|
|||
var Console2 = require('./lib/console2.js'),
|
||||
LogWriter = require('./lib/logWriter.js');
|
||||
|
||||
/**
|
||||
* logsFolder
|
||||
*
|
||||
* Store current logs folder
|
||||
* @type {Array}
|
||||
*/
|
||||
var logsFolder = [];
|
||||
|
||||
/**
|
||||
* scribe
|
||||
|
@ -104,14 +97,19 @@
|
|||
|
||||
if (config.logWriter !== false) { //if config.logWriter is false, don't save logs
|
||||
|
||||
var rootPath = config.logWriter
|
||||
? config.logWriter.rootPath || scribeOpt.rootPath
|
||||
: scribeOpt.rootPath
|
||||
;
|
||||
if (!logWriter) {
|
||||
|
||||
var rootPath = config.logWriter ?
|
||||
config.logWriter.rootPath || scribeOpt.rootPath :
|
||||
scribeOpt.rootPath
|
||||
;
|
||||
|
||||
logWriter = new LogWriter(rootPath);
|
||||
}
|
||||
|
||||
listenOnConsole(
|
||||
console,
|
||||
logWriter || new LogWriter(rootPath)
|
||||
logWriter
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue