Project

General

Profile

« Previous | Next » 

Revision 12812

lib/sh/util.sh: log(): factored out helper function log_msg!()

View differences:

trunk/lib/sh/util.sh
493 493
	echo "${highlight:+[${format}m}$1${highlight:+}"
494 494
}
495 495

  
496
log() # highlights log_level 1 messages to stand out against other output
497
{ if can_log; then echo "$log_indent$PS4$(highlight_msg "$1")" >&"$log_fd"; fi;}
496
log_msg!() # highlights log_level 1 messages to stand out against other output
497
{ echo "$log_indent$PS4$(highlight_msg "$1")" >&"$log_fd"; }
498 498

  
499
log() { if can_log; then log_msg! "$@"; fi; }
500

  
499 501
log_custom() # usage: symbol=... log_custom msg
500 502
{ log_indent="${log_indent//[^ ]/$symbol}" PS4="${PS4//[^ ]/$symbol}" log "$@";}
501 503

  

Also available in: Unified diff