Skip to content

Commit a2aae3c

Browse files
More logs for rsyncer (#657)
1 parent 8681f7b commit a2aae3c

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/murfey/client/rsync.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ def parse_stdout(line: str):
421421
# This marks the start of a transfer, wait for the progress line
422422
next_file = update
423423
return
424+
logger.warning(f"Unknown line from rsync {line}")
425+
return
424426

425427
def parse_stderr(line: str):
426428
if line.strip():
@@ -563,13 +565,19 @@ def parse_stderr(line: str):
563565
self.notify(update)
564566
success = False
565567

566-
if result is None:
568+
if result is None and files:
567569
# Only log this as an error if files were scheduled for transfer
568-
if files:
569-
logger.error(f"No rsync process ran for files: {files}")
570-
else:
571-
logger.log(
572-
logging.WARNING if result.returncode else logging.DEBUG,
570+
logger.error(f"No rsync process ran for files: {files}")
571+
elif result and result.returncode:
572+
logger.warning(
573573
f"rsync process finished with return code {result.returncode}",
574574
)
575+
elif not success:
576+
logger.info(
577+
"rsync process failed for some files: "
578+
f"requested {len(relative_filenames)}, transferred {len(transfer_success)}",
579+
)
580+
else:
581+
logger.debug("rsync process finished successfully")
582+
575583
return success

0 commit comments

Comments
 (0)