Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forward all unknown options passed to pino/file transport to destination #1234

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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