Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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