浏览代码

Set up default logging

Ben Firshman 12 年之前
父节点
当前提交
8005254138
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      plum/cli/main.py

+ 11 - 0
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()