Skip to content

Instantly share code, notes, and snippets.

@pisceanfoot
Created August 24, 2017 04:05
Show Gist options
  • Save pisceanfoot/28b99ca69dafbce727d13239d7f98522 to your computer and use it in GitHub Desktop.
Save pisceanfoot/28b99ca69dafbce727d13239d7f98522 to your computer and use it in GitHub Desktop.
display log in console for lettuce
import logging
import sys
root = logging.getLogger()
root.setLevel(logging.INFO)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
root.addHandler(ch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment