diff options
author | Todd Willey <todd@ansolabs.com> | 2011-01-07 20:09:54 +0000 |
---|---|---|
committer | Tarmac <> | 2011-01-07 20:09:54 +0000 |
commit | 05ccbb75c45aa3c348162043495e1a3d279e5b06 (patch) | |
tree | 7ebd7318bdf4caa1058ea7088764534c2eaca8f0 /nova/exception.py | |
parent | cbd67da1ae2a24462767a5a2aad0861792652c09 (diff) | |
parent | 149ea349592a9fa60057e290e7659aad65b6cf65 (diff) | |
download | nova-05ccbb75c45aa3c348162043495e1a3d279e5b06.tar.gz nova-05ccbb75c45aa3c348162043495e1a3d279e5b06.tar.xz nova-05ccbb75c45aa3c348162043495e1a3d279e5b06.zip |
Wrap logs so we can:
* use a "context" kwarg to track requests all the way through the system
* use a custom formatter so we get the data we want (configurable with flags)
* allow additional formatting for debug statements for easer debugging
* add an AUDIT level, useful for noticing changes to system components
* use named logs instead of the general logger where it makes sesnse
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nova/exception.py b/nova/exception.py index 277033e0f..7680e534a 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -21,9 +21,8 @@ Nova base exception handling, including decorator for re-raising Nova-type exceptions. SHOULD include dedicated exception logging. """ -import logging -import sys -import traceback +from nova import log as logging +LOG = logging.getLogger('nova.exception') class ProcessExecutionError(IOError): @@ -84,7 +83,7 @@ def wrap_exception(f): except Exception, e: if not isinstance(e, Error): #exc_type, exc_value, exc_traceback = sys.exc_info() - logging.exception(_('Uncaught exception')) + LOG.exception(_('Uncaught exception')) #logging.error(traceback.extract_stack(exc_traceback)) raise Error(str(e)) raise |