do not output server logs when testing, ability to run tests and server separately

This commit is contained in:
Matteo Pagliazzi
2016-01-29 14:43:14 +01:00
parent 361d0aa35c
commit b1848da8de
5 changed files with 26 additions and 9 deletions

View File

@@ -4,12 +4,15 @@ import winston from 'winston';
import nconf from 'nconf';
const IS_PROD = nconf.get('IS_PROD');
const IS_TEST = nconf.get('IS_TEST');
let logger = new winston.Logger();
if (IS_PROD) {
// TODO production logging, use loggly
// log errors to console too
} else if (IS_TEST) {
// Do not log anything when testing
} else {
logger
.add(winston.transports.Console, {