]> arthur.barton.de Git - bup.git/commit
Don't include CR or LF in log, debug, and progress messages
authorAlexander Barton <alex@barton.de>
Wed, 31 Dec 2014 01:01:13 +0000 (02:01 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 31 Dec 2014 17:48:17 +0000 (18:48 +0100)
commit79d49421f406f884a5f6f5f886ae550bcfb03eff
tree83ec8a05c2b27796c76ccf98b663d2dff0228dfa
parent2c701c08a2785434f8bebf84a82e1eeae116e531
Don't include CR or LF in log, debug, and progress messages

Adjust the log(), debug1(), debug2(), add_error(), and fatal() functions
to not include CR or LF in the message text. Instead modify log() to add
appropriate line feed (LF) or carriage returns (CR).

In addition, introduce to new functions to handle progress messages:
progress_update() and progress_end() -- and remove the old [q]progress()
function.

The idea is that progress_update() displays a message on stderr when
the process is connected to a TTY that becomes overwritten by log()
messages and further progress_{update|end}() messages.
progress_end() thereby enforce a line feed (LF), so that this message
always is preserved for the user to read.
And log() messages are always written to stderr, weather the process is
connected to a terminal or not (and always include a LF, too).

Not having CR and/or LF characters in log messages allows us, to forward
these messages to other log targets which are not "line based", like
syslog for example.

Signed-off-by: Alexander Barton <alex@barton.de>
37 files changed:
cmd/bloom-cmd.py
cmd/cat-file-cmd.py
cmd/daemon-cmd.py
cmd/damage-cmd.py
cmd/drecurse-cmd.py
cmd/fsck-cmd.py
cmd/ftp-cmd.py
cmd/fuse-cmd.py
cmd/index-cmd.py
cmd/join-cmd.py
cmd/list-idx-cmd.py
cmd/margin-cmd.py
cmd/memtest-cmd.py
cmd/meta-cmd.py
cmd/midx-cmd.py
cmd/mux-cmd.py
cmd/on-cmd.py
cmd/random-cmd.py
cmd/restore-cmd.py
cmd/save-cmd.py
cmd/server-cmd.py
cmd/split-cmd.py
cmd/tag-cmd.py
cmd/web-cmd.py
cmd/xstat-cmd.py
lib/bup/bloom.py
lib/bup/client.py
lib/bup/drecurse.py
lib/bup/git.py
lib/bup/hashsplit.py
lib/bup/helpers.py
lib/bup/index.py
lib/bup/ls.py
lib/bup/metadata.py
lib/bup/midx.py
lib/bup/ssh.py
lib/bup/vfs.py