Skip to content

Instantly share code, notes, and snippets.

@uzername
Created September 24, 2013 16:04
Show Gist options
  • Save uzername/6687087 to your computer and use it in GitHub Desktop.
Save uzername/6687087 to your computer and use it in GitHub Desktop.
self.__logger = logging.getLogger(__name__)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
fh = logging.FileHandler('spam.log')
fh.setFormatter(formatter)
self.__logger.addHandler(fh)
@uzername
Copy link
Author

python logging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment