Project

General

Profile

« Previous | Next » 

Revision 9407

lib/sh/util.sh: added $verbosity_min to set a `verbosity_min` value after the command name, etc. has been logged, so that the logging itself is not output with the new verbosity

View differences:

lib/sh/util.sh
524 524

  
525 525
disable_logging() { set_fds "$log_fd>/dev/null"; }
526 526

  
527
function command() # usage: [cmd_log_fd=|1|2|#] command extern_cmd...
527
function command()
528
# usage: [cmd_log_fd=|1|2|#] [verbosity_min=] command extern_cmd...
528 529
# to view only explicitly-displayed errors: explicit_errors_only=1 script...
529 530
{
530
	kw_params cmd_log_fd
531
	kw_params cmd_log_fd verbosity_min
531 532
	# if no cmd_log_fd, limit log_fd in case command uses util.sh
532 533
	local cmd_log_fd="${cmd_log_fd-$log_fd}"
533 534
	
......
539 540
			exec 2>&"$err_fd" # assume fd 2 used for errors
540 541
		fi
541 542
		
543
		if test "$verbosity_min"; then verbosity_min "$verbosity_min"; fi
544
		
542 545
		exec -- "$@" # -- so cmd name not treated as `exec` option
543 546
	) || return
544 547
}

Also available in: Unified diff