summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-11-25 19:28:42 +0000
committerGerrit Code Review <review@openstack.org>2015-11-25 19:28:42 +0000
commit9938f668f4a4810df3bfa3cd09442b349e519d69 (patch)
tree55104d9708e47c71fa64773a18928c418376f43c
parente0d0fe83cea39707a397863a2d474fd2beb9f2d9 (diff)
parent6dba2ed591c357a722076db498a6c29657f8760d (diff)
downloadoslo-messaging-9938f668f4a4810df3bfa3cd09442b349e519d69.tar.gz
Merge "Add Warning when we cannot notify"
-rw-r--r--oslo_messaging/notify/_impl_log.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/oslo_messaging/notify/_impl_log.py b/oslo_messaging/notify/_impl_log.py
index 40833e9..fa6e1f3 100644
--- a/oslo_messaging/notify/_impl_log.py
+++ b/oslo_messaging/notify/_impl_log.py
@@ -16,6 +16,7 @@
# under the License.
import logging
+import warnings
from oslo_serialization import jsonutils
from oslo_utils import strutils
@@ -40,3 +41,7 @@ class LogDriver(notifier.Driver):
method = getattr(logger, priority.lower(), None)
if method:
method(strutils.mask_password(jsonutils.dumps(message)))
+ else:
+ warnings.warn('Unable to log message as notify cannot find a '
+ 'logger with the priority specified '
+ '%s' % priority.lower())