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.4 to 2.3.0

4

index.js

@@ -15,4 +15,4 @@ 'use strict'

50: 'ERROR',
40: 'WARN',
30: 'INFO',
40: 'WARN ',
30: 'INFO ',
20: 'DEBUG',

@@ -19,0 +19,0 @@ 10: 'TRACE'

{
"name": "pino-pretty",
"version": "2.2.4",
"version": "2.3.0",
"description": "Prettifier for Pino log lines",

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

"devDependencies": {
"pino": "^5.8.1",
"pino": "^5.9.0",
"pre-commit": "^1.2.2",

@@ -46,0 +46,0 @@ "snazzy": "^8.0.0",

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

formatted,
`[${epoch}] INFO (${pid} on ${hostname}): foo\n`
`[${epoch}] INFO (${pid} on ${hostname}): foo\n`
)

@@ -69,3 +69,3 @@ cb()

formatted,
`[${epoch}] \u001B[32mINFO\u001B[39m (${pid} on ${hostname}): \u001B[36mfoo\u001B[39m\n`
`[${epoch}] \u001B[32mINFO \u001B[39m (${pid} on ${hostname}): \u001B[36mfoo\u001B[39m\n`
)

@@ -86,3 +86,3 @@ cb()

formatted,
`INFO [${epoch}] (${pid} on ${hostname}): foo\n`
`INFO [${epoch}] (${pid} on ${hostname}): foo\n`
)

@@ -103,3 +103,3 @@ cb()

formatted,
`[${epoch}] INFO (${pid} on ${hostname}): baz\n`
`[${epoch}] INFO (${pid} on ${hostname}): baz\n`
)

@@ -120,3 +120,3 @@ cb()

formatted,
`[2018-03-30 17:35:28.992 +0000] INFO (${pid} on ${hostname}): foo\n`
`[2018-03-30 17:35:28.992 +0000] INFO (${pid} on ${hostname}): foo\n`
)

@@ -139,3 +139,3 @@ cb()

formatted,
`[${utcHour}:35:28 ${offset}] INFO (${pid} on ${hostname}): foo\n`
`[${utcHour}:35:28 ${offset}] INFO (${pid} on ${hostname}): foo\n`
)

@@ -159,3 +159,3 @@ cb()

formatted,
`[${localDate} ${localHour}:35:28.992 ${offset}] INFO (${pid} on ${hostname}): foo\n`
`[${localDate} ${localHour}:35:28.992 ${offset}] INFO (${pid} on ${hostname}): foo\n`
)

@@ -181,3 +181,3 @@ cb()

formatted,
`[${localDate} ${localHour}:35:28 ${offset}] INFO (${pid} on ${hostname}): foo\n`
`[${localDate} ${localHour}:35:28 ${offset}] INFO (${pid} on ${hostname}): foo\n`
)

@@ -203,3 +203,3 @@ cb()

const formatted = pretty(chunk.toString())
t.match(formatted, /\[.*\] INFO: hello world/)
t.match(formatted, /\[.*\] INFO : hello world/)
cb()

@@ -216,3 +216,3 @@ }

const msg = 'hello world'
const regex = new RegExp('\\[.*\\] INFO \\(' + name + ' on ' + hostname + '\\): ' + msg)
const regex = new RegExp('\\[.*\\] INFO \\(' + name + ' on ' + hostname + '\\): ' + msg)

@@ -241,3 +241,3 @@ const opts = {

const msg = 'hello world'
const regex = new RegExp('\\[.*\\] INFO \\(' + name + '/' + pid + '\\): ' + msg)
const regex = new RegExp('\\[.*\\] INFO \\(' + name + '/' + pid + '\\): ' + msg)

@@ -265,3 +265,3 @@ const opts = {

const msg = 'hello world'
const regex = new RegExp('\\[.*\\] INFO \\(' + process.pid + ' on ' + hostname + '\\): ' + msg)
const regex = new RegExp('\\[.*\\] INFO \\(' + process.pid + ' on ' + hostname + '\\): ' + msg)

@@ -291,3 +291,3 @@ const opts = {

const formatted = pretty(chunk.toString())
t.is(formatted, `[undefined] INFO (${pid} on ${hostname}): hello world\n`)
t.is(formatted, `[undefined] INFO (${pid} on ${hostname}): hello world\n`)
cb()

@@ -343,3 +343,3 @@ }

const formatted = pretty(chunk.toString())
t.is(formatted, `[${epoch}] INFO (matteo/${pid} on ${hostname}): hello world\n`)
t.is(formatted, `[${epoch}] INFO (matteo/${pid} on ${hostname}): hello world\n`)
cb()

@@ -391,3 +391,3 @@ }

chunk.toString(),
`[${epoch}] INFO (${pid} on ${hostname}): foo\n`
`[${epoch}] INFO (${pid} on ${hostname}): foo\n`
)

@@ -412,3 +412,3 @@ cb()

formatted,
`INFO [${epoch}] (${pid} on ${hostname}): foo\n`
`INFO [${epoch}] (${pid} on ${hostname}): foo\n`
)

@@ -433,3 +433,3 @@ cb()

undefined,
`[${epoch}] INFO (${pid} on ${hostname}): foo\n foo: {\n "bar": true\n }\n`
`[${epoch}] INFO (${pid} on ${hostname}): foo\n foo: {\n "bar": true\n }\n`
]

@@ -458,3 +458,3 @@ const log = pino({}, new Writable({

formatted = pretty(`{"msg":"hello world", "time":${epoch}, "level":30, "v":1}`)
t.is(formatted, `[${epoch}] INFO: hello world\n`)
t.is(formatted, `[${epoch}] INFO : hello world\n`)
})

@@ -473,3 +473,3 @@

formatted,
`[${epoch}] INFO (${pid} on ${hostname}): foo\n`
`[${epoch}] INFO (${pid} on ${hostname}): foo\n`
)

@@ -513,3 +513,3 @@ cb()

chunk + '',
`[${epoch}] INFO (${pid} on ${hostname}): \n a: {\n "b": "c"\n }\n n: null\n`
`[${epoch}] INFO (${pid} on ${hostname}): \n a: {\n "b": "c"\n }\n n: null\n`
)

@@ -516,0 +516,0 @@ cb()

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

child.stdout.on('data', (data) => {
t.is(data.toString(), `[${epoch}] INFO (42 on foo): hello world\n`)
t.is(data.toString(), `[${epoch}] INFO (42 on foo): hello world\n`)
})

@@ -29,3 +29,3 @@ child.stdin.write(logLine)

child.stdout.on('data', (data) => {
t.is(data.toString(), `INFO [${epoch}] (42 on foo): hello world\n`)
t.is(data.toString(), `INFO [${epoch}] (42 on foo): hello world\n`)
})

@@ -41,3 +41,3 @@ child.stdin.write(logLine)

child.stdout.on('data', (data) => {
t.is(data.toString(), `[2018-03-30 17:35:28.992 +0000] INFO (42 on foo): hello world\n`)
t.is(data.toString(), `[2018-03-30 17:35:28.992 +0000] INFO (42 on foo): hello world\n`)
})

@@ -53,3 +53,3 @@ child.stdin.write(logLine)

child.stdout.on('data', (data) => {
t.is(data.toString(), `[${epoch}] INFO (42 on foo): hello world\n`)
t.is(data.toString(), `[${epoch}] INFO (42 on foo): hello world\n`)
})

@@ -56,0 +56,0 @@ child.stdin.write(logLine)

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

t.is(lines.length, expected.length + 1)
t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): hello world`)
t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): hello world`)
cb()

@@ -93,3 +93,3 @@ }

t.is(lines.length, expected.length + 6)
t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): `)
t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): `)
t.match(lines[1], /\s{4}err: {/)

@@ -125,3 +125,3 @@ t.match(lines[2], /\s{6}"type": "Error",/)

t.is(lines.length, expected.length + 6)
t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): `)
t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): `)
t.match(lines[1], /\s{4}err: {$/)

@@ -156,3 +156,3 @@ t.match(lines[2], /\s{6}"type": "Error",$/)

t.is(lines.length, expected.length + 7)
t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): `)
t.is(lines[0], `[${epoch}] INFO (${pid} on ${hostname}): `)
t.match(lines[1], /\s{4}err: {/)

@@ -159,0 +159,0 @@ t.match(lines[2], /\s{6}"type": "Error",/)

Sorry, the diff of this file is not supported yet

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