From 2a61e80071b28925d41c335eab569aad8d455ab0 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Fri, 12 Sep 2014 23:06:18 +0800 Subject: [PATCH] only output exception in verbose mode --- shadowsocks/local.py | 5 +++-- shadowsocks/server.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/shadowsocks/local.py b/shadowsocks/local.py index e7bf48d..5aeee3b 100755 --- a/shadowsocks/local.py +++ b/shadowsocks/local.py @@ -68,8 +68,9 @@ def main(): loop.run() except (KeyboardInterrupt, IOError, OSError) as e: logging.error(e) - import traceback - traceback.print_exc() + if config['verbose']: + import traceback + traceback.print_exc() os._exit(1) if __name__ == '__main__': diff --git a/shadowsocks/server.py b/shadowsocks/server.py index c896a25..0ad46fb 100755 --- a/shadowsocks/server.py +++ b/shadowsocks/server.py @@ -79,8 +79,9 @@ def main(): loop.run() except (KeyboardInterrupt, IOError, OSError) as e: logging.error(e) - import traceback - traceback.print_exc() + if config['verbose']: + import traceback + traceback.print_exc() os._exit(1) if int(config['workers']) > 1: