Update log level explanation on README.md to make slightly clearer #2551
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.
I was quite confused by the log level explanation on the README, and end up losing a good few minutes debugging my code because of it.
I know that right on the start of the Logging Levels section it explains how winston follows RFC5424, but later the explanation for how the
levelfilter defines the "maximum level" of messages logged can read quite oddly and potentially lead to confusion due to the unfamiliarity of having a filter that only lets through "X severity and higher [severity]" messages.It is especially confusing if you read where it says:
And miss the "which includes error messages" (as I did) -- double especially given that it says
sysloglevels there, but seems to actually mean "npm", given that it says "only error" (when in reality, if using syslog, it would logerrorand above). If you make that confusion (as I did), the two examples there seem to contradict each other.I think it'd be ideal to write this part of the readme in a way that takes advantage of cognitive/processing fluency -- ie. in a way that reads familiar, basically avoiding this min/max severity/number thing. However, to remain completely technical and avoid subjectivity, my aim here is to just try and lessen the chance a bit of someone doing the same mistake as I.
So what I did was:
npminstead ofsyslogas it didn't fully make sense before