Merge pull request #37 from guillaumewuip/fix-logFolder

Allow one log folder for multiple consoles
This commit is contained in:
Mathew Kurian 2015-01-24 10:30:37 -06:00
commit 5c4e3b6c89
2 changed files with 18 additions and 7 deletions

View file

@ -0,0 +1,18 @@
var scribe = require('../scribe.js')({
createDefaultConsole : false
});
var consoleOne = scribe.console({
logWriter : {
rootPath : "testLogs"
}
});
var consoleTwo = scribe.console({
logWriter : {
rootPath : "testLogs"
}
});
//both will log in /testLogs
consoleOne.log("Hello one");
consoleOne.log("Hello two");

View file

@ -31,13 +31,6 @@
this.rootPath = rootPath || 'logs';
//Check if the folder is already in use
if (rootPaths.indexOf(this.rootPath) > -1) {
throw new Error('Folder ' + this.rootPath + ' already in use');
} else {
rootPaths.push(this.rootPath);
}
//Init history
this.initHistory();
};