Socket
Socket
Sign inDemoInstall

pino-pretty

Package Overview
Dependencies
Maintainers
4
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-pretty - npm Package Compare versions

Comparing version 3.4.0 to 3.5.0

3

lib/constants.js

@@ -39,4 +39,5 @@ 'use strict'

'timestamp',
'v'
'v',
'caller'
]
}

@@ -247,2 +247,7 @@ 'use strict'

line += ')'
if (log.caller) {
line += ` <${log.caller}>`
}
return line

@@ -249,0 +254,0 @@ }

{
"name": "pino-pretty",
"version": "3.4.0",
"version": "3.5.0",
"description": "Prettifier for Pino log lines",

@@ -46,3 +46,3 @@ "main": "index.js",

"devDependencies": {
"pino": "^5.13.4",
"pino": "^5.14.0",
"pre-commit": "^1.2.2",

@@ -52,4 +52,4 @@ "rimraf": "^3.0.0",

"standard": "^14.0.0",
"tap": "^14.9.1"
"tap": "^14.10.2"
}
}

@@ -601,3 +601,32 @@ 'use strict'

t.test('prettifies trace caller', (t) => {
t.plan(1)
const traceCaller = (instance) => {
const { symbols: { asJsonSym } } = pino
const get = (target, name) => name === asJsonSym ? asJson : target[name]
function asJson (...args) {
args[0] = args[0] || {}
args[0].caller = '/tmp/script.js'
return instance[asJsonSym].apply(this, args)
}
return new Proxy(instance, { get })
}
const pretty = prettyFactory()
const log = traceCaller(pino({}, new Writable({
write (chunk, enc, cb) {
const formatted = pretty(chunk.toString())
t.is(
formatted,
`[${epoch}] INFO (${pid} on ${hostname}) </tmp/script.js>: foo\n`
)
cb()
}
})))
log.info('foo')
})
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