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 4.0.2 to 4.0.3

2

index.js

@@ -136,3 +136,3 @@ 'use strict'

} else {
const skipKeys = [messageKey, levelKey].filter(key => typeof log[key] === 'string')
const skipKeys = [messageKey, levelKey, timestampKey].filter(key => typeof log[key] === 'string' || typeof log[key] === 'number')
const prettifiedObject = prettifyObject({

@@ -139,0 +139,0 @@ input: log,

{
"name": "pino-pretty",
"version": "4.0.2",
"version": "4.0.3",
"description": "Prettifier for Pino log lines",

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

@@ -653,3 +653,10 @@ 'use strict'

t.test('handles specified timestampKey', (t) => {
t.plan(1)
const pretty = prettyFactory({ timestampKey: '@timestamp' })
const arst = pretty(`{"msg":"hello world", "@timestamp":${epoch}, "level":30}`)
t.is(arst, `[${epoch}] INFO : hello world\n`)
})
t.end()
})

@@ -103,3 +103,16 @@ 'use strict'

t.test('uses specified timestampKey', (t) => {
t.plan(1)
const env = { TERM: 'dumb' }
const child = spawn(process.argv[0], [bin, '--timestampKey', '@timestamp'], { env })
child.on('error', t.threw)
child.stdout.on('data', (data) => {
t.is(data.toString(), '[1522431328992] INFO : hello world\n')
})
const logLine = '{"level":30,"@timestamp":1522431328992,"msg":"hello world"}\n'
child.stdin.write(logLine)
t.tearDown(() => child.kill())
})
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