From 39af3f79fc4e540a9b544df8ae8055dc0194378e Mon Sep 17 00:00:00 2001 From: balaji-atoa Date: Thu, 22 Aug 2024 19:09:50 +0530 Subject: [PATCH] normalize only default levels --- pino.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pino.js b/pino.js index 63106ff31..2398e5acb 100644 --- a/pino.js +++ b/pino.js @@ -89,7 +89,7 @@ function pino (...args) { const instance = {} const { opts, stream } = normalize(instance, caller(), ...args) - if (opts?.level && (opts?.customLevels && opts?.customLevels[opts?.level] === undefined) && typeof opts.level === 'string') opts.level = opts.level.toLowerCase() + if (opts.level && typeof opts.level === 'string' && DEFAULT_LEVELS[opts.level.toLowerCase()] !== undefined) opts.level = opts.level.toLowerCase() const { redact,