only output exception in verbose mode

This commit is contained in:
clowwindy 2014-09-12 23:06:18 +08:00
parent ea70a5bd79
commit 2a61e80071
2 changed files with 6 additions and 4 deletions

View file

@ -68,8 +68,9 @@ def main():
loop.run() loop.run()
except (KeyboardInterrupt, IOError, OSError) as e: except (KeyboardInterrupt, IOError, OSError) as e:
logging.error(e) logging.error(e)
import traceback if config['verbose']:
traceback.print_exc() import traceback
traceback.print_exc()
os._exit(1) os._exit(1)
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -79,8 +79,9 @@ def main():
loop.run() loop.run()
except (KeyboardInterrupt, IOError, OSError) as e: except (KeyboardInterrupt, IOError, OSError) as e:
logging.error(e) logging.error(e)
import traceback if config['verbose']:
traceback.print_exc() import traceback
traceback.print_exc()
os._exit(1) os._exit(1)
if int(config['workers']) > 1: if int(config['workers']) > 1: