Last active
September 10, 2015 15:54
-
-
Save nelsnelson/0c3c81c49643b5395b27 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
#! /usr/bin/env python | |
import logging | |
import sys | |
log_format = "%(asctime)s %(levelname)s [%(name)s] %(message)s" | |
formatter = logging.Formatter(log_format) | |
handler = logging.StreamHandler() | |
handler.setFormatter(formatter) | |
log = logging.getLogger(__name__) | |
log.addHandler(handler) | |
log.setLevel(logging.INFO) | |
def main(): | |
log.info('Hello, world!') | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment