node-bunyan
node-bunyan copied to clipboard
Support "warning" as an alias for "warn"
Having ones app fail because someone configured the log level to be warning
rather than warn
is not much fun and seems like this could be avoided by supporting warning
as an alias for warn
.
Example:
Failed to start server: Error: unknown level name: "warning"
at resolveLevel (/app/node_modules/bunyan/lib/bunyan.js:293:19)
or maybe throw an error if it doesn't match something
@ORESoftware Not sure I understand? Throwing an error is precisely what calling .warning()
does today does – this issue is about adding .warning()
as an alias for .warn()
to avoid crashes when someone mistakenly picks the noun rather than the verb as the method name (which is easy, considering that .error()
can be both the noun and the verb and .info()
is a noun and not a verb)
@voxpelli oh I see what you're saying, yeah I kinda agree now
Just happened to me. Would be a great thing
Agreed, confusing terminology as @voxpelli stated
The IETF syslog standard uses warning
, not warn
, and this has already generated confusion and errors.
same with err
and error
.
And these can be hard to test for, because those are typically only called for rare exception cases.
The logger.child()
construction style also makes monkey patching this non-obvious.