0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

chore(logger): avoid message if level remains the same (#4991)

This commit is contained in:
Marc Bernard 2024-12-11 15:00:08 -05:00 committed by GitHub
parent dee09011cb
commit 15dddbe9e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'@verdaccio/logger-commons': patch
---
chore(logger): avoid message if level remains the same

View file

@ -93,7 +93,10 @@ export function createLogger(
/* eslint-disable */ /* eslint-disable */
/* istanbul ignore next */ /* istanbul ignore next */
if (process.env.DEBUG) { if (process.env.DEBUG) {
logger.on('level-change', (lvl, val, prevLvl, prevVal) => { logger.on('level-change', (lvl, val, prevLvl, prevVal, instance) => {
if (logger !== instance) {
return;
}
debug('%s (%d) was changed to %s (%d)', lvl, val, prevLvl, prevVal); debug('%s (%d) was changed to %s (%d)', lvl, val, prevLvl, prevVal);
}); });
} }