1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/lib/logger.js

18 lines
437 B
JavaScript
Raw Normal View History

var log4js = require('log4js');
log4js.clearAppenders();
log4js.addAppender(log4js.appenders.console());
2015-03-10 16:30:56 +01:00
var logger = log4js.getLogger('unleash');
// TODO: make level configurable
if (process.env.NODE_ENV === 'production') {
logger.setLevel(log4js.levels.ERROR);
2015-12-01 11:56:53 +01:00
} else if (process.env.NODE_ENV === 'test') {
logger.setLevel(log4js.levels.ERROR);
2015-03-10 16:30:56 +01:00
} else {
logger.setLevel(log4js.levels.DEBUG);
}
2015-12-01 11:56:53 +01:00
module.exports = logger;