diff options
author | Kun Huang <gareth@unitedstack.com> | 2013-07-22 00:02:56 +0800 |
---|---|---|
committer | Kun Huang <gareth@unitedstack.com> | 2013-07-30 23:29:01 +0800 |
commit | 4e46f9807a74b97aaae8178c551258ca0bf97759 (patch) | |
tree | ba18bd3ec61d30c36544952cb8f5dd2aec61cf8e /tests | |
parent | 97a5b49d96f4ed31c8fa9795d835480d58da82cd (diff) | |
download | keystone-4e46f9807a74b97aaae8178c551258ca0bf97759.tar.gz keystone-4e46f9807a74b97aaae8178c551258ca0bf97759.tar.xz keystone-4e46f9807a74b97aaae8178c551258ca0bf97759.zip |
use 'exc_info=True' instead of import traceback
We need log traceback message sometime, but people who ignore 'exc_info'
argument would import traceback for getting traceback message. This work
is already done by 'exc_info' in logging module. For example:
logger.error('msg', exc_info=True)
# exc_info evaluate as true and log
message from sys.exc_info()
logger.debug('msg', exc_info=(type, value, traceback))
# exc_info evaluate as an exception
tuple and log message from this
tuple
logger.exception('msg')
# exception add exc_info=1 automatically
Change-Id: I9e1caf05fcf06bb977597076ebe278b593d70bf4
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions