¡@

Home 

OpenStack Study: log_notifier.py

OpenStack Index

**** CubicPower OpenStack Study ****

def notify(_context, message):

    """Notifies the recipient of the desired event given the model.

    Log notifications using openstack's default logging system.

    """

    priority = message.get('priority',

                           CONF.default_notification_level)

    priority = priority.lower()

    logger = logging.getLogger(

        'neutron.openstack.common.notification.%s' %

        message['event_type'])

    getattr(logger, priority)(jsonutils.dumps(message))