mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
lightningd: have logging include an optional node_id for each entry.
A log can have a default node_id, which can be overridden on a per-entry basis. This changes the format of logging, so some tests need rework. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -732,9 +732,13 @@ class LightningNode(object):
|
||||
'to CHANNELD_NORMAL'])
|
||||
return scid
|
||||
|
||||
def subd_pid(self, subd):
|
||||
def subd_pid(self, subd, peerid=None):
|
||||
"""Get the process id of the given subdaemon, eg channeld or gossipd"""
|
||||
ex = re.compile(r'lightning_{}.*: pid ([0-9]*),'.format(subd))
|
||||
if peerid:
|
||||
ex = re.compile(r'{}-.*lightning_{}.*: pid ([0-9]*),'
|
||||
.format(peerid, subd))
|
||||
else:
|
||||
ex = re.compile('lightning_{}-.*: pid ([0-9]*),'.format(subd))
|
||||
# Make sure we get latest one if it's restarted!
|
||||
for l in reversed(self.daemon.logs):
|
||||
group = ex.search(l)
|
||||
@@ -1024,7 +1028,7 @@ class NodeFactory(object):
|
||||
# getpeers.
|
||||
if not fundchannel:
|
||||
for src, dst in connections:
|
||||
dst.daemon.wait_for_log('openingd-{} chan #[0-9]*: Handed peer, entering loop'.format(src.info['id']))
|
||||
dst.daemon.wait_for_log(r'{}-.*lightning_openingd-chan #[0-9]*: Handed peer, entering loop'.format(src.info['id']))
|
||||
return nodes
|
||||
|
||||
# If we got here, we want to fund channels
|
||||
|
||||
Reference in New Issue
Block a user