Created
June 11, 2016 12:32
-
-
Save Bogdaan/7af86421bae704bbe371d57517720138 to your computer and use it in GitHub Desktop.
Decode hhvm error logs (strip escape seq., fix newlines etc.)
This file contains hidden or 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
| #!/usr/bin/env python | |
| import io | |
| import codecs | |
| import sys | |
| with io.open('error.log', 'r', encoding='ascii', errors='ignore') as file: | |
| for line in file: | |
| print line.encode('utf-8').decode('string_escape') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment