From be3b5f11e82863641d592c1cf6ff86b54c8e3468 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 29 Apr 2017 10:32:27 +0930 Subject: [PATCH] contrib/pylightning: allow getpeer with log level. Signed-off-by: Rusty Russell --- contrib/pylightning/lightning/lightning.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/contrib/pylightning/lightning/lightning.py b/contrib/pylightning/lightning/lightning.py index 96be0ecca..d50016fb0 100644 --- a/contrib/pylightning/lightning/lightning.py +++ b/contrib/pylightning/lightning/lightning.py @@ -78,10 +78,13 @@ class LightningRpc(UnixDomainSocketRpc): between calls, but it does not (yet) support concurrent calls. """ - def getpeer(self, peer_id): - """Get info about a specific peer. + def getpeer(self, peer_id, log_level=None): + """Get info about a specific peer, optionally with its log. """ - peers = self.getpeers()['peers'] + if log_level: + peers = self.getpeers(log_level)['peers'] + else: + peers = self.getpeers()['peers'] for p in peers: if p['peerid'] == peer_id: return p