hide traceback when log level is INFO/WARNING/ERROR/CRITICAL

This commit is contained in:
debugtalk
2018-02-20 01:15:57 +08:00
parent 90719db8de
commit 00a8d1be8a
2 changed files with 5 additions and 1 deletions

View File

@@ -1 +1 @@
__version__ = '0.9.2'
__version__ = '0.9.3'

View File

@@ -68,6 +68,10 @@ def main_hrun():
log_level = getattr(logging, args.log_level.upper())
logging.basicConfig(level=log_level)
if log_level >= 20:
# hide traceback when log level is INFO/WARNING/ERROR/CRITICAL
sys.tracebacklimit = 0
project_name = args.startproject
if project_name:
project_path = os.path.join(os.getcwd(), project_name)