Skip to content

Commit

Permalink
Added test case for setting child logger level at creation time (pino…
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-stevel committed Jun 9, 2024
1 parent 037e900 commit b79c867
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/browser-child.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ test('child has parent level', ({ end, same, is }) => {
end()
})

test('child can set level at creation time', ({ end, same, is }) => {
const instance = pino({
level: 'error',
browser: {}
})

const child = instance.child({}, { level: 'info' }) // first bindings, then options

same(child.level, 'info')
end()
})

test('changing child level does not affect parent', ({ end, same, is }) => {
const instance = pino({
level: 'error',
Expand Down

0 comments on commit b79c867

Please sign in to comment.