Skip to content

Instantly share code, notes, and snippets.

@Bogdaan
Created June 11, 2016 12:32
Show Gist options
  • Select an option

  • Save Bogdaan/7af86421bae704bbe371d57517720138 to your computer and use it in GitHub Desktop.

Select an option

Save Bogdaan/7af86421bae704bbe371d57517720138 to your computer and use it in GitHub Desktop.
Decode hhvm error logs (strip escape seq., fix newlines etc.)
#!/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