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:
Fuxino
2026-10-21 22:41:29 +02:00
parent 408beefc66
commit 59a3f94ec8
2 changed files with 20 additions and 12 deletions
+7 -10
View File
@@ -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