From 210411c7c9b3a290b0050152db208985a07cec78 Mon Sep 17 00:00:00 2001 From: "qin.jiang" Date: Thu, 16 Feb 2017 18:55:52 +0800 Subject: [PATCH] Support i18n for api app Wrap log info msg with _LI(), log warning msg with _LW(), to support i18n translation. Change-Id: Idff4a05a91375799f05d2cba43885041627207d5 --- ceilometer/api/app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ceilometer/api/app.py b/ceilometer/api/app.py index d506ca6c4d..22f8007a8c 100644 --- a/ceilometer/api/app.py +++ b/ceilometer/api/app.py @@ -24,6 +24,7 @@ import pecan from ceilometer.api import hooks from ceilometer.api import middleware +from ceilometer.i18n import _LI, _LW LOG = log.getLogger(__name__) @@ -99,9 +100,9 @@ def load_app(conf): configkey = str(uuid.uuid4()) APPCONFIGS[configkey] = conf - LOG.info("Full WSGI config used: %s", cfg_file) - LOG.warning("Note: Ceilometer API is deprecated; use APIs from " - "Aodh (alarms), Gnocchi (metrics) and/or Panko (events).") + LOG.info(_LI("Full WSGI config used: %s"), cfg_file) + LOG.warning(_LW("Note: Ceilometer API is deprecated; use APIs from Aodh" + " (alarms), Gnocchi (metrics) and/or Panko (events).")) return deploy.loadapp("config:" + cfg_file, global_conf={'configkey': configkey})