Support i18n for api app

Wrap log info msg with _LI(), log warning msg with _LW(),
to support i18n translation.

Change-Id: Idff4a05a91375799f05d2cba43885041627207d5
This commit is contained in:
qin.jiang 2017-02-16 18:55:52 +08:00
parent a622ab3013
commit 210411c7c9

View File

@ -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})