1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/lib/logger.js
2016-11-10 21:51:29 +01:00

22 lines
449 B
JavaScript

'use strict';
const log4js = require('log4js');
log4js.configure({
appenders: [
{ type: 'console' },
]
});
const logger = log4js.getLogger('unleash');
// TODO: make level configurable
if (process.env.NODE_ENV === 'production') {
logger.setLevel(log4js.levels.ERROR);
} else if (process.env.NODE_ENV === 'test') {
logger.setLevel(log4js.levels.ERROR);
} else {
logger.setLevel(log4js.levels.DEBUG);
}
module.exports = logger;