mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
pylightning: Split log messages on newlines
This is just cosmetic, and makes things like tracebacks much easier to read. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
643480cfd8
commit
1eb23d6b29
@ -131,7 +131,10 @@ class Plugin(object):
|
|||||||
self.stdout.flush()
|
self.stdout.flush()
|
||||||
|
|
||||||
def log(self, message, level='info'):
|
def log(self, message, level='info'):
|
||||||
self.notify('log', {'level': level, 'message': message})
|
# Split the log into multiple lines and print them
|
||||||
|
# individually. Makes tracebacks much easier to read.
|
||||||
|
for line in message.split('\n'):
|
||||||
|
self.notify('log', {'level': level, 'message': line})
|
||||||
|
|
||||||
def _multi_dispatch(self, msgs):
|
def _multi_dispatch(self, msgs):
|
||||||
"""We received a couple of messages, now try to dispatch them all.
|
"""We received a couple of messages, now try to dispatch them all.
|
||||||
|
Loading…
Reference in New Issue
Block a user