Created
March 12, 2018 16:44
-
-
Save bunyk/e0a417c47de603c0cc9a9a7fdcae4e2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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