Modify variable's using method in Log Messages

String interpolation should be delayed to be handled by the logging code,
rather than being done at the point of the logging call.
Ref:http://docs.openstack.org/developer/oslo.i18n/guidelines.html#log-translation
For example:
LOG.info(_LI('some message: variable=%s') % variable)
LOG.info(_LI('some message: variable=%s'), variable)

Change-Id: I737ca1d701402997262af2725e4f55d62f4abc20
This commit is contained in:
melissaml 2016-11-18 11:20:25 +08:00
parent 1d5cb14dd5
commit 994c6f7951
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ def load_app():
if not cfg_file:
raise cfg.ConfigFilesNotFoundError([cfg.CONF.api_paste_config])
LOG.info(_LI("Full WSGI config used: %s") % cfg_file)
LOG.info(_LI("Full WSGI config used: %s"), cfg_file)
return deploy.loadapp("config:" + cfg_file)