Install winston, add server logging
This commit is contained in:
parent
59308536f6
commit
2b121f8ee0
|
@ -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();
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue