Another improvement of info level 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.

So we should use-

LOG.info(_LI('some message: variable=%s'), variable)

instead of

LOG.info(_LI('some message: variable=%s') % variable)
Reference: http://docs.openstack.org/developer/oslo.i18n/guidelines.html

Change-Id: I409358d9e35813f1875993b96fce86a0e2bc940b
This commit is contained in:
sonu.kumar
2015-11-27 13:11:23 +05:30
parent bb9de39180
commit c7eca3fbd8
15 changed files with 33 additions and 33 deletions

View File

@@ -336,7 +336,7 @@ def do_axfr(zone_name, servers, timeout=None, source=None):
to = eventlet.Timeout(timeout)
log_info = {'name': zone_name, 'host': srv}
try:
LOG.info(_LI("Doing AXFR for %(name)s from %(host)s") % log_info)
LOG.info(_LI("Doing AXFR for %(name)s from %(host)s"), log_info)
xfr = dns.query.xfr(srv['host'], zone_name, relativize=False,
timeout=1, port=srv['port'], source=source)