forked from winstonjs/winston
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[api test doc] Small updates to docs. Make instances of transports on…
… logger objects lower-case variable names. Improved defaultLogger usage through require("winston").log()
- Loading branch information
Showing
9 changed files
with
113 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* logger-test.js: Tests for instances of the winston Logger | ||
* | ||
* (C) 2010 Charlie Robbins | ||
* MIT LICENSE | ||
* | ||
*/ | ||
|
||
require.paths.unshift(require('path').join(__dirname, '..', 'lib')); | ||
|
||
var path = require('path'), | ||
vows = require('vows'), | ||
assert = require('assert'), | ||
winston = require('winston'), | ||
helpers = require('./helpers'); | ||
|
||
vows.describe('winston').addBatch({ | ||
"The winston module": { | ||
topic: function () { | ||
winston.defaultTransports().console.level = 'silly'; | ||
return null; | ||
}, | ||
"should have the correct methods defined": function () { | ||
assert.isObject(winston.transports); | ||
assert.isFunction(winston.transports.Console); | ||
assert.isFunction(winston.transports.Loggly); | ||
assert.isFunction(winston.transports.Riak); | ||
assert.isObject(winston.defaultTransports().console); | ||
|
||
['Logger', 'defaultTransports', 'add', 'remove'] | ||
.concat(Object.keys(winston.Logger.prototype.levels)) | ||
.forEach(function (m) { | ||
assert.isFunction(winston[m]); | ||
}); | ||
}, | ||
"the log() method": helpers.testLevels(winston, "should respond without an error", function (err) { | ||
assert.isNull(err); | ||
}) | ||
} | ||
}).export(module); |