Log verbose rsync output one line per message
With -v, the whole output was logged as a single Python list.
This commit is contained in:
@@ -789,20 +789,17 @@ class Backup:
|
||||
returncode = p.wait()
|
||||
|
||||
if returncode == 0:
|
||||
if self._verbose:
|
||||
logger.info('rsync: %s', output)
|
||||
else:
|
||||
# May be fewer than two lines, e.g. with --rsync-options q
|
||||
for r in output:
|
||||
logger.info('rsync: %s', r)
|
||||
# Without -v, only the summary, which may be fewer than two lines (e.g. with --rsync-options q)
|
||||
for r in output:
|
||||
logger.info('rsync: %s', r)
|
||||
else:
|
||||
self._returncode_log(returncode)
|
||||
|
||||
if self._verbose:
|
||||
if returncode in [23, 24]:
|
||||
logger.warning(output)
|
||||
else:
|
||||
logger.error(output)
|
||||
level = logging.WARNING if returncode in [23, 24] else logging.ERROR
|
||||
|
||||
for r in output:
|
||||
logger.log(level, 'rsync: %s', r)
|
||||
|
||||
if self._removed_count > 0 and returncode not in [0, 24]:
|
||||
# With --remove-before-backup, old backups are already gone if the new one failed
|
||||
|
||||
Reference in New Issue
Block a user