Skip to content

Commit 935b891

Browse files
authored
Merge pull request #6 from mhariri/patch-1
Prefix all log lines with the process name
2 parents 9b4b381 + 21910ff commit 935b891

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)