Add log format to i18n

Change-Id: I3aff0de418b52b1f16f5863c95ad2700678143ae
This commit is contained in:
zheng yin 2016-07-17 18:02:05 +08:00
parent c69a49a473
commit ecce7947dd

View File

@ -237,8 +237,8 @@ class Application(object):
""" """
if self._read_affinity and self.sorting_method != 'affinity': if self._read_affinity and self.sorting_method != 'affinity':
self.logger.warning( self.logger.warning(
"sorting_method is set to '%s', not 'affinity'; " _("sorting_method is set to '%s', not 'affinity'; "
"read_affinity setting will have no effect." % "read_affinity setting will have no effect."),
self.sorting_method) self.sorting_method)
def get_object_ring(self, policy_idx): def get_object_ring(self, policy_idx):
@ -557,17 +557,18 @@ class Application(object):
except ValueError: # not in pipeline; ignore it except ValueError: # not in pipeline; ignore it
pass pass
self.logger.info( self.logger.info(
'Adding required filter %s to pipeline at position %d' % _('Adding required filter %(filter_name)s to pipeline at '
(filter_name, insert_at)) 'position %(insert_at)d'),
{'filter_name': filter_name, 'insert_at': insert_at})
ctx = pipe.create_filter(filter_name) ctx = pipe.create_filter(filter_name)
pipe.insert_filter(ctx, index=insert_at) pipe.insert_filter(ctx, index=insert_at)
pipeline_was_modified = True pipeline_was_modified = True
if pipeline_was_modified: if pipeline_was_modified:
self.logger.info("Pipeline was modified. New pipeline is \"%s\".", self.logger.info(_("Pipeline was modified. "
pipe) "New pipeline is \"%s\"."), pipe)
else: else:
self.logger.debug("Pipeline is \"%s\"", pipe) self.logger.debug(_("Pipeline is \"%s\""), pipe)
def app_factory(global_conf, **local_conf): def app_factory(global_conf, **local_conf):