Skip to content

Commit

Permalink
Merge 1f1371c into 1c98f75
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Aug 18, 2021
2 parents 1c98f75 + 1f1371c commit 5e3cc4e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 35 deletions.
3 changes: 0 additions & 3 deletions lib/tools.js
Expand Up @@ -363,9 +363,6 @@ function createArgsNormalizer (defaultOptions) {
}
opts = Object.assign({}, defaultOptions, opts)
opts.serializers = Object.assign({}, defaultOptions.serializers, opts.serializers)
if ('extreme' in opts) {
throw Error('The extreme option has been removed, use pino.destination({ sync: false }) instead')
}
if ('onTerminated' in opts) {
throw Error('The onTerminated option has been removed, use pino.final instead')
}
Expand Down
8 changes: 0 additions & 8 deletions pino.js
Expand Up @@ -172,14 +172,6 @@ function pino (...args) {

module.exports = pino

module.exports.extreme = (dest = process.stdout.fd) => {
process.emitWarning(
'The pino.extreme() option is deprecated and will be removed in v7. Use pino.destination({ sync: false }) instead.',
{ code: 'extreme_deprecation' }
)
return buildSafeSonicBoom({ dest, minLength: 4096, sync: false })
}

module.exports.destination = (dest = process.stdout.fd) => {
if (typeof dest === 'object') {
dest.dest = dest.dest || process.stdout.fd
Expand Down
24 changes: 0 additions & 24 deletions test/syncfalse.test.js
Expand Up @@ -112,31 +112,7 @@ test('sync false with child', async ({ equal, teardown }) => {
})
})

test('throw an error if extreme is passed', async ({ throws }) => {
const pino = require('..')
throws(() => {
pino({ extreme: true })
})
})

test('flush does nothing with sync true (default)', async () => {
const instance = require('..')()
instance.flush()
})

test('pino.extreme() emits a warning', async ({ equal }) => {
const pino = require('..')
process.removeAllListeners('warning')
process.nextTick(() => pino.extreme(0))
const warning = await once(process, 'warning')
const expected = 'The pino.extreme() option is deprecated and will be removed in v7. Use pino.destination({ sync: false }) instead.'
equal(expected, warning.message)
equal('extreme_deprecation', warning.code)
})

test('pino.extreme() defaults to stdout', async ({ equal }) => {
const pino = require('..')
process.removeAllListeners('warning')
const dest = pino.extreme()
equal(dest.fd, process.stdout.fd)
})

0 comments on commit 5e3cc4e

Please sign in to comment.