pino
pino copied to clipboard
Accept log level env var as UPPER or LOWER case
Currently it won't accept UPPER case log levels. But why "DEBUG" is invalid?
"DEBUG" should be as valid as "debug".
When setting level, please convert the input to lower case :)
formatters: { level: (label) => {return { level: label.toUpperCase() }; }, },
The above snippet can help u transform log levels to uppercase.
Would you like to send a Pull Request to address this issue? Remember to add unit tests.
@jsumners i can take it up.
@jsumners raised a PR. can u please check https://github.com/pinojs/pino/pull/2034 :)
formatters: { level: (label) => {return { level: label.toUpperCase() }; }, },
@balaji-atoa any idea why this doesn't actually work? this is my config I'm passing to pino
pino({ formatters: { level(label) { return { level: label.toUpperCase() }; } }, level: 'debug', browser: { asObject: true }, });
output looks like
If you are using [email protected] or later, please open a new issue.