Skip to content

Commit 21910ff

Browse files
committed
Prefix all log lines with the process name
To be able to process the output of this plugin, it is much better if we can assume that all output lines are prefixed with the process name and channel.
1 parent 9b4b381 commit 21910ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

supervisor_stdout.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def main():
1919
def event_handler(event, response):
2020
line, data = response.split('\n', 1)
2121
headers = dict([ x.split(':') for x in line.split() ])
22-
print '%s %s | %s'%(headers['processname'], headers['channel'], data),
22+
lines = data.split('\n')
23+
prefix = '%s %s | '%(headers['processname'], headers['channel'])
24+
print '\n'.join([ prefix + l for l in lines ])
2325

2426
if __name__ == '__main__':
2527
main()

0 commit comments

Comments
 (0)