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

pino-http

Package Overview
Dependencies
Maintainers
4
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 4.2.0 to 4.3.0

9

logger.js

@@ -32,2 +32,5 @@ 'use strict'

var autoLogging = (opts.autoLogging !== false)
delete opts.autoLogging
var logger = wrapChild(opts, theStream)

@@ -67,4 +70,6 @@ var genReqId = reqIdGenFactory(opts.genReqId)

res.on('finish', onResFinished)
res.on('error', onResFinished)
if (autoLogging) {
res.on('finish', onResFinished)
res.on('error', onResFinished)
}

@@ -71,0 +76,0 @@ if (next) {

{
"name": "pino-http",
"version": "4.2.0",
"version": "4.3.0",
"description": "High-speed HTTP logger for Node.js",

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

@@ -100,2 +100,3 @@ # pino-http  [![Build Status](https://travis-ci.org/pinojs/pino-http.svg)](https://travis-ci.org/pinojs/pino-http)[![Coverage Status](https://coveralls.io/repos/github/pinojs/pino-http/badge.svg?branch=master)](https://coveralls.io/github/pinojs/pino-http?branch=master)

* `customLogLevel`: set to a `function (res, err) => { /* returns level name string */ }`. This function will be invoked to determine the level at which the log should be issued. This option is mutually exclusive with the `useLevel` option. The first argument is the HTTP response. The second argument is an error object if an error has occurred in the request.
* `autoLogging`: set to `false` to disable the automatic "request completed" and "request errored" logging. Defaults to `true`.
* `stream`: same as the second parameter

@@ -102,0 +103,0 @@

@@ -267,2 +267,30 @@ 'use strict'

test('no auto logging with autoLogging set to false', function (t) {
var dest = split(JSON.parse)
var logger = pinoHttp({ autoLogging: false }, dest)
var timeout
function handle (req, res) {
logger(req, res)
setTimeout(function () {
res.end('hello world')
}, 100)
}
dest.on('data', function (line) {
clearTimeout(timeout)
t.error(line)
t.end()
})
setup(t, logger, function (err, server) {
t.error(err)
doGet(server)
timeout = setTimeout(function () {
t.end()
}, 200)
}, handle)
})
function expectResponseTime (t, dest, logger, handle) {

@@ -269,0 +297,0 @@ setup(t, logger, function (err, server) {

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