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

pino-http

Package Overview
Dependencies
Maintainers
2
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-http - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

3

logger.js

@@ -70,2 +70,3 @@ 'use strict'

var prevLogger = opts.logger
var prevGenReqId = opts.genReqId
var logger = null

@@ -75,4 +76,6 @@

opts.logger = undefined
opts.genReqId = undefined
logger = prevLogger.child(opts)
opts.logger = prevLogger
opts.genReqId = prevGenReqId
} else {

@@ -79,0 +82,0 @@ logger = pino(opts, stream)

2

package.json
{
"name": "pino-http",
"version": "1.3.0",
"version": "1.3.1",
"description": "High-speed HTTP logger for Node.js",

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

@@ -194,1 +194,32 @@ 'use strict'

})
test('support a custom instance with custom genReqId function', function (t) {
var dest = split(JSON.parse)
var idToTest
function genReqId (req) {
t.ok(req.url, 'The first argument must be the request parameter')
idToTest = (Date.now() + Math.random()).toString(32)
return idToTest
}
var logger = pinoHttp({
logger: pino(dest),
genReqId: genReqId
})
setup(t, logger, function (err, server) {
t.error(err)
doGet(server)
})
dest.on('data', function (line) {
t.ok(line.req, 'req is defined')
t.ok(line.res, 'res is defined')
t.notOk(line.genReqId)
t.equal(line.msg, 'request completed', 'message is set')
t.equal(line.req.method, 'GET', 'method is get')
t.equal(line.res.statusCode, 200, 'statusCode is 200')
t.end()
})
})
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