Correction gestion des logs

This commit is contained in:
wpetit 2015-10-30 12:01:44 +01:00
parent e5e1748503
commit f56e2b7f4f
3 changed files with 13 additions and 4 deletions

View File

@ -2,7 +2,7 @@ var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
var Menu = require('menu');
var isDev = process.env.NODE_ENV === 'development';
var constants = require('./'+(isDev ? 'src': 'dist')+'/util').Const;
var Util = require('./'+(isDev ? 'src': 'dist')+'/util');
var mainWindow = null;
@ -41,3 +41,7 @@ app.on('ready', function() {
});
});
process.on('exit', function(code) {
Util.Logger.info('Exiting with code "%s"', code || 0);
});

View File

@ -8,7 +8,6 @@ module.exports = function loggerMiddleware(store) {
next(action);
if(action.error) {
logger.error(action.type, action.error);
return app.quit(1);
}
};
};

View File

@ -6,12 +6,18 @@ var logFile = process.env.PITAYA_LOG_FILE;
logger.level = logLevel;
logger.add(winston.transports.Console, { colorize: true });
logger.add(winston.transports.Console, {
colorize: true,
handleExceptions: true,
humanReadableUnhandledException: true
});
if(logFile) {
logger.add(winston.transports.File, {
filename: logFile,
json: false
json: false,
handleExceptions: true,
humanReadableUnhandledException: true
});
}