Skip to content

Commit

Permalink
New: Add destroy method
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 10, 2018
1 parent d89c752 commit 2368fdb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ function getLogger(namespace){
logger[level] = makeLogLevel(level);
});

logger.destroy = function(){
logger.removeAllListeners();
};

return logger;
}

Expand Down
4 changes: 3 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ describe('glogg', function(){
});

afterEach(function(done){
logger.removeAllListeners();
expect(global['glogg-test']).to.exist();
logger.destroy();
expect(global['glogg-test']).to.not.exist();
done();
});

Expand Down

0 comments on commit 2368fdb

Please # to comment.