simple log information

When it has the same log information, we can use a function to simple
it, then it also improve code readability.

Change-Id: I5bb901099dcc832fc0651b34707901849abb0c34
This commit is contained in:
zheng yin 2016-07-29 12:12:55 +08:00
parent ab2b844669
commit dd5afdb686

View File

@ -201,12 +201,9 @@ class ObjectReplicator(Daemon):
if self.rsync_error_log_line_length:
error_line = error_line[:self.rsync_error_log_line_length]
self.logger.error(error_line)
elif results:
self.logger.info(
_("Successful rsync of %(src)s at %(dst)s (%(time).03f)"),
{'src': args[-2], 'dst': args[-1], 'time': total_time})
else:
self.logger.debug(
log_method = self.logger.info if results else self.logger.debug
log_method(
_("Successful rsync of %(src)s at %(dst)s (%(time).03f)"),
{'src': args[-2], 'dst': args[-1], 'time': total_time})
return ret_val