Skip to content

Instantly share code, notes, and snippets.

@bunyk
Created March 12, 2018 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bunyk/e0a417c47de603c0cc9a9a7fdcae4e2e to your computer and use it in GitHub Desktop.
Save bunyk/e0a417c47de603c0cc9a9a7fdcae4e2e to your computer and use it in GitHub Desktop.
import sys
import json
for line in sys.stdin:
try:
entry = json.loads(line)
print('\033[0;37m', entry['time'], entry['level'], '\033[0m', entry['msg'])
except ValueError:
print('\033[0;31m!', line, '\033[0m')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment