Install winston, add server logging

This commit is contained in:
Matt 2016-04-12 22:55:51 -04:00
parent 59308536f6
commit 2b121f8ee0
3 changed files with 11 additions and 1 deletions

View File

@ -57,6 +57,14 @@ ipcMain.on('light', function(event, arg) {
});
var log = {};
var logger = new (winston.Logger)({
transports: [
new (winston.transports.Console)(),
new (winston.transports.File)({ filename: './logs/mcopy.log' })
]
});
log.init = function () {
'use strict';
log.listen();

View File

@ -33,6 +33,7 @@
"dependencies": {
"node-notifier": "^4.5.0",
"node-uuid": "^1.4.7",
"serialport": "^2.1.0"
"serialport": "^2.1.0",
"winston": "^2.2.0"
}
}

View File

@ -24,6 +24,7 @@ log.init = function () {
log.listen = function () {
ipcRender.on('log', function (event, arg) {
console.log(arg);
//log.display(arg.action, arg.service, arg.status, arg.time);
return event.returnValue = true;
});
};