Skip to content

Commit

Permalink
fix: allow using non-lowercase custom levels (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
chernodub authored Jul 3, 2024
1 parent 749c9fa commit dfd3e93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function pinoLogger (opts, stream) {

function getValidLogLevel (level, defaultValue = 'info') {
if (level && typeof level === 'string') {
const logLevel = level.trim().toLowerCase()
const logLevel = level.trim()
if (validLogLevels.includes(logLevel) === true) {
return logLevel
}
Expand Down
6 changes: 3 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ test('uses the log level passed in as an option, where the level is a custom one
const logger = pinoHttp(
{
customLevels: {
custom: 25
infoCustom: 25
},
useLevel: 'custom',
level: 'custom'
useLevel: 'infoCustom',
level: 'infoCustom'
},
dest
)
Expand Down

0 comments on commit dfd3e93

Please sign in to comment.