Project

General

Profile

« Previous | Next » 

Revision 14723

lib/sh/util.sh: echo_func(): use new format_stack_frame, which adds call context information to what was provided by func_loc

View differences:

trunk/lib/sh/util.sh
65 65
function canon_rel_path() { echo "$1"; }
66 66

  
67 67
function echo_func() { :; }
68
alias echo_func='"echo_func" "$FUNCNAME" "$@" && indent || true'
68
alias echo_func='"echo_func" "$@" && indent || true'
69 69

  
70 70
function echo_run() { :; }
71 71
alias echo_run='"echo_run" ' # last space alias-expands next word
......
887 887

  
888 888
# usage: func() { echo_func; ... }
889 889
function echo_func()
890
# usage: "echo_func" "$FUNCNAME" "$@" && indent || true
890
# usage: "echo_func" "$@" && indent || true
891 891
# exit status: whether function call was echoed
892 892
{
893 893
	log_local; log++; can_log || return
894
	local func="$1"; shift
895
	local loc; loc="$(log++ func_loc "$func")" || return
896
	echo_cmd "$func" "$@" "   $(plain "@$loc")"
894
	log "$(
895
		log+ 2 # hide internal logging commands
896
		skip_stack_frame # must be inside () to limit its effects
897
		exclude='log*' get_stack_frame_after # remove log* prefix to echo_func
898
		format_stack_frame "$@"
899
	)"
897 900
}
898 901
# see echo_func alias after stub
899 902

  

Also available in: Unified diff