Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(log): output logs in production mode
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mrfelton committed Sep 16, 2018
1 parent d80ef40 commit 4e8225a
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions app/lib/lnd/neutrino.js
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 4e8225a

Please sign in to comment.