Skip to content

Commit

Permalink
Adding clear function to module for use with default logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvin French-Owen authored and pksunkara committed Sep 18, 2012
1 parent 8ecd17c commit 7cf37e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/winston.js
Expand Up @@ -71,6 +71,7 @@ var methods = [
'stream',
'add',
'remove',
'clear',
'profile',
'startTimer',
'extend',
Expand Down
12 changes: 6 additions & 6 deletions test/winston-test.js
Expand Up @@ -13,7 +13,7 @@ var fs = require('fs'),
assert = require('assert'),
winston = require('../lib/winston'),
helpers = require('./helpers');

vows.describe('winston').addBatch({
"The winston module": {
topic: function () {
Expand All @@ -30,7 +30,7 @@ vows.describe('winston').addBatch({
assert.isObject(winston.default.transports.console);
assert.isFalse(winston.emitErrs);
assert.isObject(winston.config);
['Logger', 'add', 'remove', 'extend']
['Logger', 'add', 'remove', 'extend', 'clear']
.concat(Object.keys(winston.config.npm.levels))
.forEach(function (key) {
assert.isFunction(winston[key]);
Expand Down Expand Up @@ -76,15 +76,15 @@ vows.describe('winston').addBatch({
assert.isObject(winston.default.transports.console);
assert.isFalse(winston.emitErrs);
assert.isObject(winston.config);

var newLevels = Object.keys(winston.config.syslog.levels);
['Logger', 'add', 'remove', 'extend']
['Logger', 'add', 'remove', 'extend', 'clear']
.concat(newLevels)
.forEach(function (key) {
assert.isFunction(winston[key]);
});


Object.keys(winston.config.npm.levels)
.filter(function (key) {
return newLevels.indexOf(key) === -1;
Expand Down

0 comments on commit 7cf37e0

Please sign in to comment.