Skip to content

Commit

Permalink
style: improve test coverage for logger
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Aug 25, 2022
1 parent 05c5c8c commit 7ecff50
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions packages/server/js/logger.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
const logLevelNum = {
error: 3,
warn: 2,
info: 1,
verbose: 0,
default: 1
}

module.exports = class Logger {
constructor (logLevel) {
switch (logLevel) {
case 'error':
this.logLevel = 3
break
case 'warn':
this.logLevel = 2
break
case 'info':
this.logLevel = 1
break
case 'verbose':
this.logLevel = 0
break
default:
this.logLevel = 1
}
this.logLevel = logLevelNum[logLevel] || logLevelNum.default
}

verbose () {
Expand Down

0 comments on commit 7ecff50

Please sign in to comment.