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
No known key found for this signature in database
GPG Key ID: 1416D83DC4F0E86D
1 changed files with
4 additions and
1 deletions
-
contrib/pylightning/lightning/plugin.py
|
@ -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. |
|
|