Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding clear function to module for use with default logger

  • Loading branch information...
commit 142d9fdcd62624b84ae76c8cbaa701451d91f913 1 parent b40c636
@calvinfo calvinfo authored
Showing with 7 additions and 6 deletions.
  1. +1 −0  lib/winston.js
  2. +6 −6 test/winston-test.js
View
1  lib/winston.js
@@ -71,6 +71,7 @@ var methods = [
'stream',
'add',
'remove',
+ 'clear',
'profile',
'startTimer',
'extend',
View
12 test/winston-test.js
@@ -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 () {
@@ -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]);
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.