'make check' clean

master
Trent Mick 2014-08-25 00:50:53 -07:00
parent a3e7081be6
commit 7ef6b120db
2 changed files with 13 additions and 10 deletions

View File

@ -349,7 +349,7 @@ function Logger(options, _childOptions, _childSimple) {
level: (options.level ? resolveLevel(options.level) : INFO)
});
} else if (options.streams) {
options.streams.forEach(function(s) {
options.streams.forEach(function (s) {
s.level = s.level || s.level;
self.addStream(s);
});
@ -414,7 +414,7 @@ util.inherits(Logger, EventEmitter);
* 'file' stream when `path` is given, false otherwise.
* See README.md for full details.
*/
Logger.prototype.addStream = function(s) {
Logger.prototype.addStream = function addStream(s) {
var self = this;
s = objCopy(s);
@ -440,12 +440,12 @@ Logger.prototype.addStream = function(s) {
}
switch (s.type) {
case 'stream':
case 'stream':
if (!s.closeOnExit) {
s.closeOnExit = false;
}
break;
case 'file':
case 'file':
if (!s.stream) {
s.stream = fs.createWriteStream(s.path,
{flags: 'a', encoding: 'utf8'});
@ -461,7 +461,7 @@ Logger.prototype.addStream = function(s) {
}
}
break;
case 'rotating-file':
case 'rotating-file':
assert.ok(!s.stream,
'"rotating-file" stream should not give a "stream"');
assert.ok(s.path);
@ -472,12 +472,12 @@ Logger.prototype.addStream = function(s) {
s.closeOnExit = true;
}
break;
case 'raw':
case 'raw':
if (!s.closeOnExit) {
s.closeOnExit = false;
}
break;
default:
default:
throw new TypeError('unknown stream type "' + s.type + '"');
}
@ -488,10 +488,10 @@ Logger.prototype.addStream = function(s) {
/**
* Add serializers
*
* @param serializers {Object} Optional. Object mapping log record field names to
* serializing functions. See README.md for details.
* @param serializers {Object} Optional. Object mapping log record field names
* to serializing functions. See README.md for details.
*/
Logger.prototype.addSerializers = function(serializers) {
Logger.prototype.addSerializers = function addSerializers(serializers) {
var self = this;
if (!self.serializers) {

View File

@ -31,6 +31,7 @@ test('ensure Logger creation options', function (t) {
var options = {name: 'foo', stream: process.stdout, streams: []};
t.throws(function () { new Logger(options); },
/* JSSTYLED */
/cannot mix "streams" and "stream" options/,
'cannot use "stream" and "streams"');
@ -76,6 +77,7 @@ test('ensure Logger creation options (createLogger)', function (t) {
var options = {name: 'foo', stream: process.stdout, streams: []};
t.throws(function () { bunyan.createLogger(options); },
/* JSSTYLED */
/cannot mix "streams" and "stream" options/,
'cannot use "stream" and "streams"');
@ -114,6 +116,7 @@ test('ensure Logger child() options', function (t) {
var options = {stream: process.stdout, streams: []};
t.throws(function () { log.child(options); },
/* JSSTYLED */
/cannot mix "streams" and "stream" options/,
'cannot use "stream" and "streams"');