Socket
Socket
Sign inDemoInstall

pino-multi-stream

Package Overview
Dependencies
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-multi-stream - npm Package Compare versions

Comparing version 5.2.0 to 5.3.0

10

multistream.js

@@ -29,2 +29,3 @@ 'use strict'

add,
flushSync,
minLevel: 0,

@@ -80,2 +81,10 @@ streams: [],

function flushSync () {
for (const { stream } of this.streams) {
if (typeof stream.flushSync === 'function') {
stream.flushSync()
}
}
}
function add (dest) {

@@ -121,2 +130,3 @@ const { streams } = this

clone,
flushSync,
[metadata]: true

@@ -123,0 +133,0 @@ }

2

package.json
{
"name": "pino-multi-stream",
"version": "5.2.0",
"version": "5.3.0",
"description": "A wrapper for the Pino logger that provides Bunyan's multipe destination stream API",

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

'use strict'
var writeStream = require('flush-write-stream')
const { join } = require('path')
const { readFileSync } = require('fs')
const os = require('os')
var test = require('tap').test

@@ -434,1 +437,25 @@ var pino = require('pino')

})
test('flushSync', function (t) {
const tmp = join(
os.tmpdir(),
'_' + Math.random().toString(36).substr(2, 9)
)
const destination = pino.destination({ dest: tmp, sync: false, minLength: 4096 })
const log = pino({ level: 'info' }, multistream([{ level: 'info', stream: destination }]))
destination.on('ready', () => {
log.info('foo')
log.info('bar')
t.is(readFileSync(tmp, { encoding: 'utf-8' }).split('\n').length - 1, 0)
pino.final(log, (err, finalLogger) => {
if (err) {
t.fail()
return t.done()
}
t.is(readFileSync(tmp, { encoding: 'utf-8' }).split('\n').length - 1, 2)
finalLogger.info('biz')
t.is(readFileSync(tmp, { encoding: 'utf-8' }).split('\n').length - 1, 3)
t.done()
})()
})
})

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

write (formatted, enc) {
t.is(formatted, 'INFO\t: foo\n')
t.is(formatted, 'INFO: foo\n')
t.done()

@@ -318,3 +318,3 @@ }

write (formatted, enc) {
t.is(formatted, 'INFO\t: foo\n')
t.is(formatted, 'INFO: foo\n')
t.done()

@@ -321,0 +321,0 @@ }

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