notifier: add audit level

This maps what is provided by the openstack.common.logging module.

Change-Id: Id581c4c748e2763a2c9a3e576e3bd497595adbff
This commit is contained in:
Julien Danjou 2013-11-27 11:48:09 +01:00
parent 5912b58233
commit 010163d8ee
2 changed files with 13 additions and 0 deletions

View File

@ -170,6 +170,18 @@ class Notifier(object):
if self._driver_mgr.extensions:
self._driver_mgr.map(do_notify)
def audit(self, ctxt, event_type, payload):
"""Send a notification at audit level.
:param ctxt: a request context dict
:type ctxt: dict
:param event_type: describes the event, e.g. 'compute.create_instance'
:type event_type: str
:param payload: the notification payload
:type payload: dict
"""
self._notify(ctxt, event_type, payload, 'AUDIT')
def debug(self, ctxt, event_type, payload):
"""Send a notification at debug level.

View File

@ -99,6 +99,7 @@ class TestMessagingNotifier(test_utils.BaseTestCase):
]
_priority = [
('audit', dict(priority='audit')),
('debug', dict(priority='debug')),
('info', dict(priority='info')),
('warn', dict(priority='warn')),