From 8005254138c3b7d02b24e047374d7579cc7f0612 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Fri, 13 Dec 2013 19:19:44 +0000 Subject: [PATCH] Set up default logging --- plum/cli/main.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plum/cli/main.py b/plum/cli/main.py index 2bd8f3bab..191b2f487 100644 --- a/plum/cli/main.py +++ b/plum/cli/main.py @@ -16,7 +16,18 @@ from .docopt_command import NoSuchCommand log = logging.getLogger(__name__) + def main(): + console_handler = logging.StreamHandler() + console_handler.setFormatter(logging.Formatter()) + console_handler.setLevel(logging.INFO) + root_logger = logging.getLogger() + root_logger.addHandler(console_handler) + root_logger.setLevel(logging.DEBUG) + + # Disable requests logging + logging.getLogger("requests").propagate = False + try: command = TopLevelCommand() command.sys_dispatch()