Skip to content

Commit

Permalink
forward all unknown options passed to pino/file transport to destinat…
Browse files Browse the repository at this point in the history
…ion (#1234)
  • Loading branch information
mojavelinux committed Nov 20, 2021
1 parent 774c6a9 commit 0433f54
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions file.js
Expand Up @@ -4,9 +4,8 @@ const pino = require('./pino')
const { once } = require('events')

module.exports = async function (opts = {}) {
const destOpts = { dest: opts.destination || 1, sync: false }
if (opts.append === false) destOpts.append = false
if (opts.mkdir) destOpts.mkdir = true
const destOpts = Object.assign({}, opts, { dest: opts.destination || 1, sync: false })
delete destOpts.destination
const destination = pino.destination(destOpts)
await once(destination, 'ready')
return destination
Expand Down

0 comments on commit 0433f54

Please sign in to comment.