* do not log geth events for now (will add option later)

This commit is contained in:
Taegus
2019-02-08 12:11:22 +01:00
parent 5e34bf59ba
commit bc6f116f4b

View File

@@ -9,11 +9,15 @@ const os = require('os');
class Geth { class Geth {
constructor() { constructor() {
this.gethProcess = null; this.gethProcess = null;
this.logGethEvents = false;
// create the user data dir (needed for MacOS) // create the user data dir (needed for MacOS)
if (!fs.existsSync(app.getPath('userData'))) { if (!fs.existsSync(app.getPath('userData'))) {
fs.mkdirSync(app.getPath('userData')); fs.mkdirSync(app.getPath('userData'));
} }
this.logStream = fs.createWriteStream(path.join(app.getPath('userData'), 'gethlog.txt'));
if (this.logGethEvents) {
this.logStream = fs.createWriteStream(path.join(app.getPath('userData'), 'gethlog.txt'), { flags: 'a' });
}
if (appRoot.path.indexOf('app.asar') > -1) { if (appRoot.path.indexOf('app.asar') > -1) {
this.rootPath = path.dirname(appRoot.path); this.rootPath = path.dirname(appRoot.path);
@@ -39,7 +43,9 @@ class Geth {
} }
_writeLog(text) { _writeLog(text) {
this.logStream.write(text); if (this.logGethEvents) {
this.logStream.write(text);
}
} }
startGeth() { startGeth() {