winston-papertrail
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -0,1 +1,4 @@ | ||
# v0.2.2 # | ||
- Fixed a case where non-object meta would throw #27 | ||
# v0.2.1 # | ||
@@ -2,0 +5,0 @@ - Fixed a case where calling `close` before `connect` would fail to end the stream #22 |
@@ -260,3 +260,3 @@ /* | ||
if (meta && Object.keys(meta).length === 0) { | ||
if (meta && typeof meta === 'object' && Object.keys(meta).length === 0) { | ||
meta = false; | ||
@@ -263,0 +263,0 @@ } |
{ | ||
"name": "winston-papertrail", | ||
"description": "A Papertrail transport for winston", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": "Ken Perkins <ken.perkins@rackspace.com>", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -111,2 +111,110 @@ /* | ||
it('should support object meta', function (done) { | ||
var pt = new Papertrail({ | ||
host: 'localhost', | ||
port: 23456, | ||
attemptsBeforeDecay: 0, | ||
connectionDelay: 10000 | ||
}); | ||
pt.on('error', function (err) { | ||
should.not.exist(err); | ||
}); | ||
pt.on('connect', function () { | ||
(function () { | ||
pt.log('info', 'hello', { meta: 'object' }, function () { | ||
}); | ||
}).should.not.throw(); | ||
}); | ||
listener = function (data) { | ||
should.exist(data); | ||
data.toString().indexOf('default info hello\r\n').should.not.equal(-1); | ||
done(); | ||
} | ||
}); | ||
it('should support array meta', function (done) { | ||
var pt = new Papertrail({ | ||
host: 'localhost', | ||
port: 23456, | ||
attemptsBeforeDecay: 0, | ||
connectionDelay: 10000 | ||
}); | ||
pt.on('error', function (err) { | ||
should.not.exist(err); | ||
}); | ||
pt.on('connect', function () { | ||
(function () { | ||
pt.log('info', 'hello', ['object'], function () { | ||
}); | ||
}).should.not.throw(); | ||
}); | ||
listener = function (data) { | ||
should.exist(data); | ||
data.toString().indexOf('default info hello\r\n').should.not.equal(-1); | ||
done(); | ||
} | ||
}); | ||
it('should support null meta', function (done) { | ||
var pt = new Papertrail({ | ||
host: 'localhost', | ||
port: 23456, | ||
attemptsBeforeDecay: 0, | ||
connectionDelay: 10000 | ||
}); | ||
pt.on('error', function (err) { | ||
should.not.exist(err); | ||
}); | ||
pt.on('connect', function () { | ||
(function () { | ||
pt.log('info', 'hello', null, function () { | ||
}); | ||
}).should.not.throw(); | ||
}); | ||
listener = function (data) { | ||
should.exist(data); | ||
data.toString().indexOf('default info hello\r\n').should.not.equal(-1); | ||
done(); | ||
} | ||
}); | ||
it('should support non-object meta', function(done) { | ||
var pt = new Papertrail({ | ||
host: 'localhost', | ||
port: 23456, | ||
attemptsBeforeDecay: 0, | ||
connectionDelay: 10000 | ||
}); | ||
pt.on('error', function (err) { | ||
should.not.exist(err); | ||
}); | ||
pt.on('connect', function () { | ||
(function() { | ||
pt.log('info', 'hello', 'meta object', function () { | ||
}); | ||
}).should.not.throw(); | ||
}); | ||
listener = function (data) { | ||
should.exist(data); | ||
data.toString().indexOf('default info hello meta object\r\n').should.not.equal(-1); | ||
done(); | ||
} | ||
}); | ||
// TODO need to fix the TLS Server to reject new sockets that are not over tls | ||
@@ -113,0 +221,0 @@ it.skip('should fail to connect without tls', function (done) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50663
582