diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index b0b1ab6c..89a3828f 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -124,33 +124,28 @@ Blockchain.prototype.run = function() { child.on('error', (err) => { err = err.toString(); - console.error('ERROR', err); + console.error('Blockchain error: ', err); if (self.env === 'development' && err.indexOf('Failed to unlock') > 0) { console.error('\n' + __('Development blockchain has changed to use the --dev option.').yellow); console.error(__('You can reset your workspace to fix the problem with').yellow + ' embark reset'.cyan); console.error(__('Otherwise, you can change your data directory in blockchain.json (datadir)').yellow); } }); - // Geth logs appear in stderr somehow - let lastMessage; child.stdout.on('data', (data) => { console.log(`Geth error: ${data}`); }); + // Geth logs appear in stderr somehow child.stderr.on('data', (data) => { data = data.toString(); if (self.onReadyCallback && !self.readyCalled && data.indexOf('Mapped network port') > -1) { self.readyCalled = true; self.onReadyCallback(); } - lastMessage = data; console.log('Geth: ' + data); }); child.on('exit', (code) => { if (code) { console.error('Geth exited with error code ' + code); - if (lastMessage) { - console.error(lastMessage); - } } }); }); diff --git a/lib/processes/storageProcesses/ipfs.js b/lib/processes/storageProcesses/ipfs.js index f50cdc42..9cbddfbf 100644 --- a/lib/processes/storageProcesses/ipfs.js +++ b/lib/processes/storageProcesses/ipfs.js @@ -32,7 +32,6 @@ class IPFSProcess extends ProcessWrapper { startIPFSDaemon() { const self = this; const child = child_process.spawn('ipfs', ['daemon']); - let lastMessage; child.on('error', (err) => { err = err.toString(); @@ -48,15 +47,11 @@ class IPFSProcess extends ProcessWrapper { self.readyCalled = true; self.send({result: constants.storage.initiated}); } - lastMessage = data; console.log('IPFS: ' + data); }); child.on('exit', (code) => { if (code) { console.error('IPFS exited with error code ' + code); - if (lastMessage) { - console.error(lastMessage); - } } }); } diff --git a/lib/processes/storageProcesses/swarm.js b/lib/processes/storageProcesses/swarm.js index 1242184a..82599902 100644 --- a/lib/processes/storageProcesses/swarm.js +++ b/lib/processes/storageProcesses/swarm.js @@ -34,27 +34,22 @@ class SwarmProcess extends ProcessWrapper { err = err.toString(); console.error('Swarm error: ', err); }); - let lastMessage; child.stdout.on('data', (data) => { data = data.toString(); console.log(`Swarm error: ${data}`); }); - // Geth logs appear in stderr somehow + // Swarm logs appear in stderr somehow child.stderr.on('data', (data) => { data = data.toString(); if (!self.readyCalled && data.indexOf('Swarm http proxy started') > -1) { self.readyCalled = true; self.send({result: constants.storage.initiated}); } - lastMessage = data; console.log('Swarm: ' + data); }); child.on('exit', (code) => { if (code) { console.error('Swarm exited with error code ' + code); - if (lastMessage) { - console.error(lastMessage); - } } }); }