Browse Source

fix(log): log lnd stderr output as errors

Ensure that lnd output that goes to the stderr stream gets logged using
the error log level and that the cause of the error is captured.
renovate/lint-staged-8.x
Tom Kirkpatrick 6 years ago
parent
commit
d80ef40f1a
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 7
      app/lib/lnd/neutrino.js

7
app/lib/lnd/neutrino.js

@ -114,10 +114,9 @@ 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') {
const level = lndLogGetLevel(line)
lndLog[level](line)
if (level === 'error') {
this.lastError = line.split('[ERR] LTND:')[1]
lndLog.error(line)
if (line.startsWith('panic:')) {
this.lastError = line
}
}
})

Loading…
Cancel
Save