Skip to content

fix(logger.log): warn on invalid log-level#1062

Merged
lamweili merged 1 commit intolog4js-node:masterfrom
abernh:fix-1042_logger-log--warn-on-invalid-log-level
Jan 7, 2022
Merged

fix(logger.log): warn on invalid log-level#1062
lamweili merged 1 commit intolog4js-node:masterfrom
abernh:fix-1042_logger-log--warn-on-invalid-log-level

Conversation

@abernh
Copy link
Contributor

@abernh abernh commented Feb 23, 2021

a warning is logged if the log method is used with an unknown log-level
this happens whenever people confuse the log method with yet another log-level-short method (like in the browser console.log)
adjusted newLevel-test accordingly

rel: #1042

Signed-off-by: abernh a.bernhard@23go.de

a warning is logged if the `log` method is used with an unknown log-level
this happens whenever people confuse the `log` method with yet another log-level-short method (like in the browser console.log)
adjusted `newLevel-test` accordingly

rel: log4js-node#1042

Signed-off-by: abernh <a.bernhard@23go.de>
@abernh
Copy link
Contributor Author

abernh commented Feb 23, 2021

One out of the 8 travis-ci builds failed, but unrelated to my PR.

not ok 16 - test/tap/fileAppender-test.js # time=3026.134ms

Copy link
Contributor

@lamweili lamweili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good addition to WARN developers that the specified level does not exist or is invalid before falling back to INFO.
Looks good and passes the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dot record console.log('xx')

2 participants