Skip to content
Snippets Groups Projects
Commit 4d744eb9 authored by Henrik Thostrup Jensen's avatar Henrik Thostrup Jensen
Browse files

add log htmlifier to distro

parent 7b0a9fa1
No related branches found
No related tags found
Loading
#!/usr/bin/env python
import sys
while True:
line = sys.stdin.readline()
line = line.strip()
line = line.replace('<', '&lt;').replace('>', '&gt;')
line = line.replace(' ', '&nbsp;')
if 'DUDBackend' in line:
color = 'ForestGreen'
elif 'NSIService' in line:
color = 'blue'
elif 'error' in line.lower():
color = 'red'
elif 'ConnectionServiceResource' in line or 'TwistedSUDS' in line:
color = 'maroon'
else:
color = 'black'
line = '<tt><font color="%s">' % color + line + '</font></tt><br>' + "\n"
sys.stdout.write(line)
sys.stdout.flush()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment