With this change, the user may specify validateLogLevels: false when
instantiating a logger in order to disable validation of log levels.
This is helpful in cases where the log levels are not known in advance.
If validateLogLevels is true, the logger behaves as it does now:
unrecognized values for the log level are detected and the associated
line is rejected, or the log level is coerced to the default value.
lib/logger.js: Add support for validateLogLevels option.
test/common/create-options.js:
test/logger-instantiation.js:
test/logger-log.js: Add tests for validateLogLevels.
With this change, the user may specify
validateLogLevels: false
when instantiating a logger in order to disable validation of log levels. This is helpful in cases where the log levels are not known in advance. IfvalidateLogLevels
is true, the logger behaves as it does now: unrecognized values for the log level are detected and the associated line is rejected, or the log level is coerced to the default value.lib/logger.js: Add support for
validateLogLevels
option.test/common/create-options.js:
test/logger-instantiation.js:
test/logger-log.js: Add tests for
validateLogLevels
.README.md:
types.d.ts: Update readme and type definitions.
Fixes: #65