fix(level): Separate concerns for the "level" parameter #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 isactually 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.