From f71a2d1a685c263baa2585d7593ddd7db8cb9071 Mon Sep 17 00:00:00 2001 From: Shuangtai Tian Date: Mon, 3 Mar 2014 10:03:03 +0800 Subject: [PATCH] Sync the log_handler from oslo When using PublishErrorsHandler, it will missing user-supplied arguments. For example, do LOG.info("blabla %s", "foo"), the payload only contains "blabla %s", but we expect it like "blabla foo". this bug has been fixed in oslo, just syncs it to ironic. Sync from Oslo, change-id: I91289cc4a60f5dab89bca852e6f52b4b83831e47 Change-Id: I9fb278be829503162f765115a83a6ab5bd10008c --- ironic/openstack/common/log_handler.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ironic/openstack/common/log_handler.py b/ironic/openstack/common/log_handler.py index fb2848581f..4b2ded1e3a 100644 --- a/ironic/openstack/common/log_handler.py +++ b/ironic/openstack/common/log_handler.py @@ -1,5 +1,3 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -13,12 +11,13 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + import logging -from ironic.openstack.common import notifier - from oslo.config import cfg +from ironic.openstack.common import notifier + class PublishErrorsHandler(logging.Handler): def emit(self, record): @@ -28,4 +27,4 @@ class PublishErrorsHandler(logging.Handler): notifier.api.notify(None, 'error.publisher', 'error_notification', notifier.api.ERROR, - dict(error=record.msg)) + dict(error=record.getMessage()))