Skip to content

Commit

Permalink
rm silent logger method, closes #434
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarkclements committed Jul 15, 2018
1 parent 50cdd29 commit 000cdb3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
2 changes: 0 additions & 2 deletions lib/proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const {
assertNoLevelCollisions
} = require('./levels')
const {
noop,
asChindings,
asJson
} = require('./tools')
Expand All @@ -42,7 +41,6 @@ const prototype = {
flush,
isLevelEnabled,
version,
silent: noop,
get level () { return this[getLevelSym]() },
set level (lvl) { return this[setLevelSym](lvl) },
get levelVal () { return this[levelValSym] },
Expand Down
26 changes: 0 additions & 26 deletions test/levels.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,6 @@ test('silent level', async ({fail}) => {
})
})

test('silent is a noop', async ({fail}) => {
const instance = pino({
level: 'silent'
}, sink((result, enc) => {
fail('no data should be logged')
}))

instance['silent']('hello world')
})

test('set silent via Infinity', async ({fail}) => {
const instance = pino({
level: Infinity
Expand All @@ -168,22 +158,6 @@ test('set silent via Infinity', async ({fail}) => {
})
})

test('silent stays a noop after level changes', async ({is, isNot, fail}) => {
const noop = require('../lib/tools').noop
const instance = pino({
level: 'silent'
}, sink((result, enc) => {
fail('no data should be logged')
}))

instance.level = 'trace'
isNot(instance[instance.level], noop)

instance.level = 'silent'
instance['silent']('hello world')
is(instance[instance.level], noop)
})

test('exposed levels', async ({same}) => {
same(Object.keys(pino.levels.values), [
'trace',
Expand Down

0 comments on commit 000cdb3

Please sign in to comment.