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(level): Separate concerns for the "level" parameter #35

Merged
merged 2 commits into from
Sep 21, 2021

Conversation

darinspivey
Copy link
Contributor

fix(level): Separate concerns for the "level" parameter

Both Winston and LogDNA have a "level" parameter, but they
mean different things. In Winston, it represents a "max"
level wherein anything logged above that level's rank will
not be logged (and thus sent to LogDNA). To disambiguate
this logger transport, the parameter will be called maxLevel,
and will only apply to Winston. LogDNA's level parameter is
actually not usable with the implementation of this transport
since all logs will be specifying a level value.

Fixes: #33


fix(levels): Automatically set up LogDNA custom levels for defaults

Winston uses "levels" as an object where the values are numeric.
If no levels are specified, it uses the "npm" levels that are
defined in their docs. These levels are not all supported by
LogDNA, so if "levels" is used, automatically set up custom
LogDNA levels based on the keys of the winston levels object.

Winston uses "levels" as an object where the values are numeric.
If no levels are specified, it uses the "npm" levels that are
defined in their docs. These levels are not all supported by
LogDNA, so if "levels" is used, automatically set up custom
LogDNA levels based on the keys of the winston levels object.
Both Winston and LogDNA have a "level" parameter, but they
mean different things. In Winston, it represents a "max"
level wherein anything logged above that level's rank will
not be logged (and thus sent to LogDNA). To disambiguate
this logger transport, the parameter will be called `maxLevel`,
and will only apply to Winston. LogDNA's `level` parameter is
actually not usable with the implementation of this transport
since all logs will be specifying a level value.

Fixes: #33
@darinspivey darinspivey requested review from a team September 21, 2021 18:47
@darinspivey darinspivey merged commit 0f734d8 into main Sep 21, 2021
@darinspivey darinspivey deleted the darinspivey/issue33 branch September 21, 2021 18:54
@logdnabot
Copy link
Member

🎉 This PR is included in version 4.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected behaviour with transport 'level' option
4 participants