import log4js from 'log4js';
const logger = log4js.getLogger('test');
logger.level = 'error';
console.log(logger.isLevelEnabled('error'));
console.log(logger.isLevelEnabled('info'));
console.log(logger.isLevelEnabled('off'));
I would expect the last statement to print false but it prints true.
The end goal is to do something like this:
import log4js from 'log4js';
if (logger.isLevelEnabled('off')) {
logger.level = 'error';
// do something here
}
I would expect the last statement to print
falsebut it printstrue.The end goal is to do something like this: