summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-01-30 17:49:29 +0000
committerGerrit Code Review <review@openstack.org>2015-01-30 17:49:29 +0000
commitc88ead72e2a5713cfd9d7df68f12334bf3c56675 (patch)
tree62cb5bf82da976c1e6e6e21d974416cd7d585cea
parent8635947984cebbf10fa1361c4a199c0a66a38f36 (diff)
parent9213022fe29d1ceafd0eb3935cea08849bac2b08 (diff)
downloadoslo-log-c88ead72e2a5713cfd9d7df68f12334bf3c56675.tar.gz
Merge "Update comment to match implementation"
-rw-r--r--oslo_log/log.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/oslo_log/log.py b/oslo_log/log.py
index 0f588c2..1f08b88 100644
--- a/oslo_log/log.py
+++ b/oslo_log/log.py
@@ -85,6 +85,20 @@ class BaseLoggerAdapter(logging.LoggerAdapter):
class KeywordArgumentAdapter(BaseLoggerAdapter):
"""Logger adapter to add keyword arguments to log record's extra data
+
+ Keywords passed to the log call are added to the "extra"
+ dictionary passed to the underlying logger so they are emitted
+ with the log message and available to the format string.
+
+ Special keywords:
+
+ extra
+ An existing dictionary of extra values to be passed to the
+ logger. If present, the dictionary is copied and extended.
+ resource
+ A dictionary-like object containing a ``name`` key or ``type``
+ and ``id`` keys.
+
"""
def process(self, msg, kwargs):
@@ -132,7 +146,7 @@ class KeywordArgumentAdapter(BaseLoggerAdapter):
# For resources that don't have the name of the format we wish
# to use (or places where the LOG call may not have the full
# object ref, allow them to pass in a dict:
- # resource={resource_type: volume, resource_id: uuid}
+ # resource={'type': volume, 'id': uuid}
resource_type = resource.get('type', None)
resource_id = resource.get('id', None)