Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

17 make nightlife rabbet capture logs in a text file #20

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
});
}

Expand Down
5 changes: 3 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down