Project

General

Profile

« Previous | Next » 

Revision 9218

lib/sh/util.sh: log_custom(): replace every non-whitespace character of $log_indent, and the first character of PS4, with the symbol, to make the symbol stand out on the line instead of the |||... before it

View differences:

lib/sh/util.sh
184 184
log() { if can_log; then echo "$log_indent$PS4$1" >&"$log_fd"; fi; }
185 185

  
186 186
# usage: symbol=... log_custom msg
187
log_custom() { local PS4="${PS4%[^ ] }$symbol "; log "$@"; }
187
log_custom()
188
{
189
	local log_indent="${log_indent//[^ ]/$symbol}" PS4="$symbol${PS4#?}"
190
	log "$@"
191
}
188 192

  
189 193
log_err() { symbol=! verbosity=1 log_fd="$err_fd" log_custom "$@"; }
190 194

  

Also available in: Unified diff