diff options
author | Singustromo <singustromo@disroot.org> | 2023-11-05 14:03:38 +0100 |
---|---|---|
committer | Singustromo <singustromo@disroot.org> | 2023-11-05 14:03:38 +0100 |
commit | ffe7e173fdffaae1300d1cd7e8cd0df7ae445045 (patch) | |
tree | 39d445abf700541e3625138bc47965cf7d075d23 | |
parent | 6e6704d9b345bed0a0ab7c784cc7da2bce8809f7 (diff) | |
download | radio-sh-ffe7e173fdffaae1300d1cd7e8cd0df7ae445045.tar.gz radio-sh-ffe7e173fdffaae1300d1cd7e8cd0df7ae445045.zip |
Simplified Sys:log()
-rwxr-xr-x | radio | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/radio b/radio index 4ea8316..fd38439 100755 --- a/radio +++ b/radio @@ -56,17 +56,16 @@ _menu_items="" # current menu Sys:log() { { [ "$_debug" == '1' ] && [ -n "$*" ]; } || return - local line_no="${BASH_LINENO[0]}" i=2 - local out="(${FUNCNAME[1]}:_LINE_) [caller: " + local i=2 + local out="(${FUNCNAME[1]}:${BASH_LINENO[1]}) [caller: " while [ -n "${FUNCNAME[$i]}" ]; do # caller functions - out+="${FUNCNAME[$i]}<" [ "${FUNCNAME[$i]}" = "${FUNCNAME[$((i-1))]}" ] \ && { i=$(( ${#BASH_LINENO[@]} )); break; } # recursive functions + out+="${FUNCNAME[$i]}<" ((i++)) done - [ "$i" -gt 2 ] && out="${out::-1}] " && line_no="${BASH_LINENO[$((i-3))]}" - out="${out//_LINE_/$line_no}" + out="${out::-1}] " printf "%s%b\n" "$out" "$*" >&2 } |