Project

General

Profile

« Previous | Next » 

Revision 8897

lib/util.sh: use new can_log wherever logging info is output to stderr

View differences:

lib/util.sh
55 55

  
56 56
can_log () { test "$log_level" -le "$verbosity"; }
57 57

  
58
echo_cmd () { echo "$PS4$*" >&2; }
58
echo_cmd () { if can_log; then echo "$PS4$*" >&2; fi; }
59 59

  
60 60
echo_run () { echo_cmd "$@"; "$@"; }
61 61

  
......
87 87

  
88 88
echo_stdin () # usage: input|echo_stdin|cmd
89 89
{
90
	echo ----- >&2
91
	tee -a /dev/stderr;
92
	echo ----- >&2
90
	if can_log; then
91
		echo ----- >&2
92
		tee -a /dev/stderr;
93
		echo ----- >&2
94
	else cat
95
	fi
93 96
}
94 97

  
95 98
echo_vars () # usage: echo_vars var...
96
{ { echo -n "$PS4"; declare -p "${@%%=*}";} >&2; }
99
{ if can_log; then { echo -n "$PS4"; declare -p "${@%%=*}";} >&2; fi; }
97 100

  
98 101
echo_export ()
99 102
{

Also available in: Unified diff