Project

General

Profile

« Previous | Next » 

Revision 8895

lib/util.sh: verbose output: added $log_level (must always be > 0 so verbosity=0 turns off all logging) and can_log (), which compares $log_level to $verbosity

View differences:

lib/util.sh
51 51

  
52 52
: "${verbosity:=$verbose}" "${verbosity:=0}"
53 53

  
54
log_level=1 # must always be > 0 so verbosity=0 turns off all logging
55

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

  
54 58
echo_cmd () { echo "$PS4$*" >&2; }
55 59

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

Also available in: Unified diff