Browse Source

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>
plugin-6
Christian Decker 6 years ago
parent
commit
69d3d6025c
No known key found for this signature in database GPG Key ID: 1416D83DC4F0E86D
  1. 5
      contrib/pylightning/lightning/plugin.py

5
contrib/pylightning/lightning/plugin.py

@ -131,7 +131,10 @@ class Plugin(object):
self.stdout.flush()
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):
"""We received a couple of messages, now try to dispatch them all.

Loading…
Cancel
Save