implement utils.print_exception()
Previously we used logging.error(e) and traceback.print_exc() to output error stack trace. The problem is, we want to output the stack trace only when verbose > 0. The if statement scattered around the code. So we replaced them with the new utils.print_exception() call.
This commit is contained in:
parent
48ddc1714b
commit
cb7062e1c1
8 changed files with 32 additions and 29 deletions
|
@ -80,10 +80,7 @@ def main():
|
|||
daemon.set_user(config.get('user', None))
|
||||
loop.run()
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
if config['verbose']:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
utils.print_exception(e)
|
||||
sys.exit(1)
|
||||
|
||||
if int(config['workers']) > 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue