diff --git a/examples/multiplesConsolesOneFolder.js b/examples/multiplesConsolesOneFolder.js new file mode 100644 index 0000000..cd5c4f2 --- /dev/null +++ b/examples/multiplesConsolesOneFolder.js @@ -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"); diff --git a/lib/logWriter.js b/lib/logWriter.js index dcea714..ae90d4c 100644 --- a/lib/logWriter.js +++ b/lib/logWriter.js @@ -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(); };