From d9044960ad59309cc5284e09d7721bddc4dee67a Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Tue, 4 Sep 2018 17:03:41 +0000 Subject: [PATCH 1/4] http: identify node/wallet in log --- lib/node/http.js | 2 +- lib/wallet/http.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node/http.js b/lib/node/http.js index c9261f33..98279d96 100644 --- a/lib/node/http.js +++ b/lib/node/http.js @@ -39,7 +39,7 @@ class HTTP extends Server { super(new HTTPOptions(options)); this.network = this.options.network; - this.logger = this.options.logger.context('http'); + this.logger = this.options.logger.context('node-http'); this.node = this.options.node; this.chain = this.node.chain; diff --git a/lib/wallet/http.js b/lib/wallet/http.js index 5ca1056b..8fec9e53 100644 --- a/lib/wallet/http.js +++ b/lib/wallet/http.js @@ -42,7 +42,7 @@ class HTTP extends Server { super(new HTTPOptions(options)); this.network = this.options.network; - this.logger = this.options.logger.context('http'); + this.logger = this.options.logger.context('wallet-http'); this.wdb = this.options.node.wdb; this.rpc = this.options.node.rpc; From da2084f503e4012cfe673e66468a963a801ed538 Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Thu, 7 Feb 2019 12:12:59 -0800 Subject: [PATCH 2/4] rpc: identify node/wallet in log --- lib/node/rpc.js | 2 +- lib/wallet/rpc.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node/rpc.js b/lib/node/rpc.js index 01ac7e0c..8c2bd0bb 100644 --- a/lib/node/rpc.js +++ b/lib/node/rpc.js @@ -100,7 +100,7 @@ class RPC extends RPCBase { this.pool = node.pool; this.fees = node.fees; this.miner = node.miner; - this.logger = node.logger.context('rpc'); + this.logger = node.logger.context('node-rpc'); this.locker = new Lock(); this.mining = false; diff --git a/lib/wallet/rpc.js b/lib/wallet/rpc.js index c74f4902..1cb1620c 100644 --- a/lib/wallet/rpc.js +++ b/lib/wallet/rpc.js @@ -89,7 +89,7 @@ class RPC extends RPCBase { this.wdb = node.wdb; this.network = node.network; - this.logger = node.logger.context('rpc'); + this.logger = node.logger.context('wallet-rpc'); this.client = node.client; this.locker = new Lock(); From 7303d284d566eb609a41ecd378f137bfb1074b9a Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Thu, 7 Feb 2019 13:37:11 -0800 Subject: [PATCH 3/4] wallet-rpc: log queries --- lib/wallet/rpc.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/wallet/rpc.js b/lib/wallet/rpc.js index 1cb1620c..67a0baee 100644 --- a/lib/wallet/rpc.js +++ b/lib/wallet/rpc.js @@ -113,6 +113,15 @@ class RPC extends RPCBase { } } + handleCall(cmd, query) { + this.logger.debug('Handling RPC call: %s.', cmd.method); + } + + handleError(err) { + this.logger.error('RPC internal error.'); + this.logger.error(err); + } + init() { this.add('help', this.help); this.add('stop', this.stop); From f0806a54dd67358e68578e5118366ea14728750c Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Thu, 7 Feb 2019 14:00:37 -0800 Subject: [PATCH 4/4] rpc: remove handleError --- lib/node/rpc.js | 5 ----- lib/wallet/rpc.js | 5 ----- 2 files changed, 10 deletions(-) diff --git a/lib/node/rpc.js b/lib/node/rpc.js index 8c2bd0bb..b9a19ddb 100644 --- a/lib/node/rpc.js +++ b/lib/node/rpc.js @@ -146,11 +146,6 @@ class RPC extends RPCBase { } } - handleError(err) { - this.logger.error('RPC internal error.'); - this.logger.error(err); - } - init() { this.add('stop', this.stop); this.add('help', this.help); diff --git a/lib/wallet/rpc.js b/lib/wallet/rpc.js index 67a0baee..80deaa9e 100644 --- a/lib/wallet/rpc.js +++ b/lib/wallet/rpc.js @@ -117,11 +117,6 @@ class RPC extends RPCBase { this.logger.debug('Handling RPC call: %s.', cmd.method); } - handleError(err) { - this.logger.error('RPC internal error.'); - this.logger.error(err); - } - init() { this.add('help', this.help); this.add('stop', this.stop);