Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nelsnelson
Last active September 10, 2015 15:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelsnelson/0c3c81c49643b5395b27 to your computer and use it in GitHub Desktop.
Save nelsnelson/0c3c81c49643b5395b27 to your computer and use it in GitHub Desktop.
#! /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