Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

winston-papertrail

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-papertrail - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

3

changelog.md

@@ -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

2

lib/winston-papertrail.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc