mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
21 lines
436 B
JavaScript
21 lines
436 B
JavaScript
'use strict';
|
|
|
|
// Logger utility
|
|
// TODO remove winston-mail and winston-newrelic if not used
|
|
let winston = require('winston');
|
|
let nconf = require('nconf');
|
|
|
|
// TODO use const?
|
|
// TODO move isProd to a single location
|
|
let isProd = nconf.get('NODE_ENV') === 'production';
|
|
|
|
let logger = new winston.Logger();
|
|
|
|
if (isProd) {
|
|
// TODO production logging
|
|
} else {
|
|
logger
|
|
.add(winston.transports.Console);
|
|
}
|
|
|
|
module.exports = logger; |