Improve debug mode (#103)

Add file, line number, function name and function line offset
This commit is contained in:
QwertyZW 2019-05-06 01:04:09 -07:00 committed by Kevin van Zonneveld
parent ba0e7150cb
commit 7b7d31a1bf
2 changed files with 2 additions and 0 deletions

View File

@ -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

View File

@ -339,6 +339,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