We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11a9b97 commit b216a27Copy full SHA for b216a27
lib/logger.js
@@ -21,6 +21,7 @@ const {
21
const {
22
validateObject,
23
validateString,
24
+ validateOneOf,
25
} = require('internal/validators');
26
27
const Utf8Stream = require('internal/streams/fast-utf8-stream');
@@ -65,10 +66,7 @@ class LogConsumer {
65
66
const { level = 'info' } = options;
67
validateString(level, 'options.level');
68
- if (!LEVELS[level]) {
69
- throw new ERR_INVALID_ARG_VALUE('options.level', level,
70
- `must be one of: ${LEVEL_NAMES.join(', ')}`);
71
- }
+ validateOneOf(level, 'options.level', LEVEL_NAMES);
72
73
this._level = level;
74
this._levelValue = LEVELS[level];
0 commit comments