Skip to content

Instantly share code, notes, and snippets.

@w495
Last active May 19, 2017 04:25
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 w495/80f6a7351a10d5b6cecb5dad6c8cd8d6 to your computer and use it in GitHub Desktop.
Save w495/80f6a7351a10d5b6cecb5dad6c8cd8d6 to your computer and use it in GitHub Desktop.
import logging
class OneLineHandler(logging.StreamHandler):
def emit(self, record):
try:
msg = self.format(record)
stream = self.stream
stream.write('\u001b[1000D' + msg)
self.flush()
except Exception:
self.handleError(record)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment