mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2025-04-19 05:06:14 +00:00
Improve debug mode (#103)
Add file, line number, function name and function line offset
This commit is contained in:
parent
ba0e7150cb
commit
7b7d31a1bf
@ -75,6 +75,7 @@ __b3bp_err_report() {
|
||||
# debug mode
|
||||
if [[ "${arg_d:?}" = "1" ]]; then
|
||||
set -o xtrace
|
||||
PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
|
||||
LOG_LEVEL="7"
|
||||
# Enable error backtracing
|
||||
trap '__b3bp_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
|
||||
|
Loading…
x
Reference in New Issue
Block a user