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
No known key found for this signature in database
GPG Key ID: 72203A8EC5967EA8
1 changed files with
7 additions and
11 deletions
app/lib/lnd/neutrino.js
@ -113,23 +113,19 @@ class Neutrino extends EventEmitter {
// Listen for when neutrino prints data to stderr.
// Listen for when neutrino prints data to stderr.
this . process . stderr . pipe ( split2 ( ) ) . on ( 'data' , line => {
this . process . stderr . pipe ( split2 ( ) ) . on ( 'data' , line => {
if ( process . env . NODE_ENV === 'development' ) {
lndLog . error ( line )
lndLog . error ( line )
if ( line . startsWith ( 'panic:' ) ) {
if ( line . startsWith ( 'panic:' ) ) {
this . lastError = line
this . lastError = line
}
}
}
} )
} )
// Listen for when neutrino prints data to stdout.
// Listen for when neutrino prints data to stdout.
this . process . stdout . pipe ( split2 ( ) ) . on ( 'data' , line => {
this . process . stdout . pipe ( split2 ( ) ) . on ( 'data' , line => {
if ( process . env . NODE_ENV === 'development' ) {
const level = lndLogGetLevel ( line )
const level = lndLogGetLevel ( line )
lndLog [ level ] ( line )
lndLog [ level ] ( line )
if ( level === 'error' ) {
if ( level === 'error' ) {
this . lastError = line . split ( '[ERR] LTND:' ) [ 1 ]
this . lastError = line . split ( '[ERR] LTND:' ) [ 1 ]
}
}
}
// password RPC server listening (wallet unlocker started).
// password RPC server listening (wallet unlocker started).
if ( ! this . walletUnlockerGrpcActive && ! this . lightningGrpcActive ) {
if ( ! this . walletUnlockerGrpcActive && ! this . lightningGrpcActive ) {