#5 Rework debugging output
Closed: Fixed Opened by tibbs.

Debugging doesn't really show what I want to see in any logical progression.

level 0

No output except *fatal* rsync errors.  "Too many connection" errors aren't fatal unless the run aborts because of them.

level 1

Should just show the start and end times.  Adding an elapsed timer would be nice, too.
Any rsync error output should be shown as well.

level 2

"calling rsync" and the various counts of files to transfer and such.
The summary line for rsync as well.

level 3

More of the "generating file lists" and maybe timing info for those.

level 4

Variable dump

level 5

Start showing rsync output.

level 6

More rsync output.

level 7

Rsync progress output.

level 8:

set -x

Level 9

zprof? Probably pointless.


While we'd love to use --info, that's new in rsync 3.1 and I wouldn't be surprised if someone isn't trying to run a mirror on rsync 2.6. RHEL5 and 6 have 3.0.6. EL7 has 3.0.9, so the Fedora masters probably don't even have --info (but you can still use some of the flags with a newer client).

Also add a level which includes a diff of fullfiletimelist.

Make sure there's a level which produces no output in the "usual case" (nothing to update or short-term lock contention), but which produces at more verbose output when dowloads happen.

And what we really want is output to a log file, with selected info going to stdout and errors to stderr as always.

Since we won't know what to output to stdout until we're actually done processing, instead redirect all output to a file, and then cat that file at the end if conditions are met. But stderr and aborts will be connected as usual. This implies either redirecting every stdout write (except for a cat at the end) or running everything inside a subshell. The former is probably simpler.

Started an implementation of proper logging.

Pretty much done now.

@tibbs changed the status to Fixed

Metadata