Browse Source

fix(log): output logs in production mode

Ensure that logs are output when the app is run in production mode. not
only development mode so that its easier to diagnose an issue with a
production build.
renovate/lint-staged-8.x
Tom Kirkpatrick 6 years ago
parent
commit
4e8225a709
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 18
      app/lib/lnd/neutrino.js

18
app/lib/lnd/neutrino.js

@ -113,22 +113,18 @@ class Neutrino extends EventEmitter {
// Listen for when neutrino prints data to stderr.
this.process.stderr.pipe(split2()).on('data', line => {
if (process.env.NODE_ENV === 'development') {
lndLog.error(line)
if (line.startsWith('panic:')) {
this.lastError = line
}
lndLog.error(line)
if (line.startsWith('panic:')) {
this.lastError = line
}
})
// Listen for when neutrino prints data to stdout.
this.process.stdout.pipe(split2()).on('data', line => {
if (process.env.NODE_ENV === 'development') {
const level = lndLogGetLevel(line)
lndLog[level](line)
if (level === 'error') {
this.lastError = line.split('[ERR] LTND:')[1]
}
const level = lndLogGetLevel(line)
lndLog[level](line)
if (level === 'error') {
this.lastError = line.split('[ERR] LTND:')[1]
}
// password RPC server listening (wallet unlocker started).

Loading…
Cancel
Save