diff --git a/app/main.js b/app/main.js index 4a8f57d..3c9a4e5 100644 --- a/app/main.js +++ b/app/main.js @@ -11,6 +11,8 @@ const {app} = electron const BrowserWindow = electron.BrowserWindow const addMenu = require('./menu').addMenu; +const winston = require('winston') + let backendProcess = undefined // Keep a global reference of the window object, if you don't, the window will @@ -28,12 +30,30 @@ function createWindow () { } function startWampRouter() { + + var wamp_logger = new (winston.Logger)({ + transports: [ + new (winston.transports.File)({ + level: 'verbose', + name: 'wamp-router', + filename: app.getPath('userData') + '/otone_data/router_logfile.txt', + json: false, + maxsize: 10*1024*1024, + maxFiles: 5, + timestamp: function(){ + const d = new Date(); + return d.toISOString(); + } + }) + ] + }); + var router = nightlife.createRouter({ httpServer: http.createServer(), port: 31947, path: '/ws', autoCreateRealms: true, - logger: new CLogger({name: 'nightlife-router'}) + logger: wamp_logger }); } diff --git a/app/package.json b/app/package.json index 340c8c0..7de113b 100644 --- a/app/package.json +++ b/app/package.json @@ -9,9 +9,10 @@ "electron-squirrel-startup": "^1.0.0", "fs": "0.0.2", "jquery": "^1.11.1", - "nightlife-rabbit": "git+https://github.com/christian-raedel/nightlife-rabbit", + "nightlife-rabbit": "git+https://github.com/opentrons/nightlife-rabbit", "node-clogger": "git+https://github.com/christian-raedel/node-clogger.git#v0.3.3", - "zip-folder": "^1.0.0" + "zip-folder": "^1.0.0", + "winston": "^2.2.0" }, "repository": { "type": "git",