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

express-bunyan-logger

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-bunyan-logger - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

.tern-port

25

index.js

@@ -106,9 +106,23 @@ var bunyan = require('bunyan'),

var json = meta;
if (excludes) {
excludes.forEach(function(ex) {
delete meta[ex];
});
json = null;
if (!~excludes.indexOf('*')) {
json = {};
var exs = {};
excludes.forEach(function(ex) {
exs[ex] = true;
});
for (var p in meta)
if (!exs[p])
json[p] = meta[p];
}
}
logFn.call(logger, meta, format(meta));
if (!json) {
logFn.call(logger, format(meta));
} else {
logFn.call(logger, json, format(meta));
}
}

@@ -120,2 +134,3 @@

}
res.on('finish', logging);

@@ -122,0 +137,0 @@ res.on('close', logging);

2

package.json
{
"name": "express-bunyan-logger",
"version": "0.2.1",
"version": "0.2.2",
"description": "a bunyan logger middleware for express",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -99,2 +99,29 @@ var express = require('express');

it('test excludes all', function(done) {
var app = express();
var output = st();
app.use(bunyanLogger({
stream: output,
excludes: ['req', '*']
}));
app.get('/', function(req, res) {
res.send('GET /');
});
request(app)
.get('/')
.expect('GET /', function(err, res) {
var json = JSON.parse(output.content.toString());
assert.equal(json.name, 'express');
console.log(json);
assert(!json.url);
assert(!json['status-code']);
assert(!json.res);
assert(!json.req);
done();
});
});
it('test errorLogger', function(done) {

@@ -101,0 +128,0 @@ var app = express();

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