Created
July 8, 2015 03:10
-
-
Save endofline/8ad52b917b79c1bbfaa5 to your computer and use it in GitHub Desktop.
[hangoutsbot] stream handler example to dump all logs straight to stdout
This file contains hidden or 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
import sys, logging | |
def _initialise(bot): | |
consoleHandler = logging.StreamHandler(stream=sys.stdout) | |
format = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") | |
consoleHandler.setFormatter(format) | |
rootLogger = logging.getLogger() | |
rootLogger.addHandler(consoleHandler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment