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 2.2.0 to 2.2.1

10

index.js

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

if (log[messageKey]) {
if (log[messageKey] && typeof log[messageKey] === 'string') {
line += color.message(log[messageKey])

@@ -194,3 +194,3 @@ }

} else {
line += filterObjects(log, messageKey, errorLikeObjectKeys)
line += filterObjects(log, typeof log[messageKey] === 'string' ? messageKey : undefined, errorLikeObjectKeys)
}

@@ -212,4 +212,8 @@

const keys = Object.keys(value)
const filteredKeys = [messageKey]
const filteredKeys = []
if (messageKey) {
filteredKeys.push(messageKey)
}
if (excludeStandardKeys !== false) {

@@ -216,0 +220,0 @@ Array.prototype.push.apply(filteredKeys, standardKeys)

{
"name": "pino-pretty",
"version": "2.2.0",
"version": "2.2.1",
"description": "Prettifier for Pino log lines",

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

@@ -8,4 +8,13 @@ 'use strict'

const dateformat = require('dateformat')
const prettyFactory = require('../')
const _prettyFactory = require('../')
function prettyFactory (opts) {
if (!opts) {
opts = { colorize: false }
} else if (!opts.hasOwnProperty('colorize')) {
opts.colorize = false
}
return _prettyFactory(opts)
}
// All dates are computed from 'Fri, 30 Mar 2018 17:35:28 GMT'

@@ -455,3 +464,28 @@ const epoch = 1522431328992

t.test('prettifies msg object', (t) => {
t.plan(6)
const expectedLines = [
' msg: {',
' "b": {',
' "c": "d"',
' }',
' }'
]
const pretty = prettyFactory()
const log = pino({}, new Writable({
write (chunk, enc, cb) {
const formatted = pretty(chunk.toString())
const lines = formatted.split('\n')
t.is(lines.length, expectedLines.length + 2)
lines.shift(); lines.pop()
for (var i = 0; i < lines.length; i += 1) {
t.is(lines[i], expectedLines[i])
}
cb()
}
}))
log.info({ msg: { b: { c: 'd' } } })
})
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