* do not log geth events for now (will add option later)
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user