forked from EvergreenCrypto/docker-finance
client/container: implement debug log-levels
DOCKER_FINANCE_DEBUG will now support the following: 0 = no debug output 1 = `print_debug` (bash/PHP) 2 = level 1 + `set -xv` (bash)
This commit is contained in:
@@ -54,7 +54,7 @@ function lib_utils::print_fatal()
|
||||
function lib_utils::print_debug()
|
||||
{
|
||||
# shellcheck disable=SC2154
|
||||
if [[ "$DOCKER_FINANCE_DEBUG" == true ]]; then
|
||||
if [[ "$DOCKER_FINANCE_DEBUG" =~ ^1$|^2$ ]]; then
|
||||
local _debug="${BASH_SOURCE[1]##*/}:${BASH_LINENO[0]} -> ${FUNCNAME[1]}"
|
||||
lib_utils::__print "\e[33m" "[DEBUG] ${_debug} -> $*"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user