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:
4
client/docker-finance.d/client/env/gen.bash
vendored
4
client/docker-finance.d/client/env/gen.bash
vendored
@@ -31,8 +31,8 @@ export DOCKER_FINANCE_VERSION="$global_client_version"
|
||||
|
||||
# Developer related
|
||||
|
||||
if [ -z "$DOCKER_FINANCE_DEBUG" ]; then
|
||||
export DOCKER_FINANCE_DEBUG=false
|
||||
if [[ -z "$DOCKER_FINANCE_DEBUG" || ! "$DOCKER_FINANCE_DEBUG" =~ ^0$|^1$|^2$ ]]; then
|
||||
export DOCKER_FINANCE_DEBUG=0
|
||||
fi
|
||||
|
||||
# Allows transparent r/w of mounted volumes
|
||||
|
||||
@@ -18,14 +18,15 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# WARNING: because of completion, the docker-finance environment file
|
||||
# is never read. Ergo, for debugging, you'll need to run the following:
|
||||
# is never read. Ergo, for debugging, you'll need to run the following
|
||||
# with log-level 1 or 2:
|
||||
#
|
||||
# `export DOCKER_FINANCE_DEBUG=true && . ~/.bashrc`
|
||||
# `export DOCKER_FINANCE_DEBUG=2 && . ~/.bashrc`
|
||||
#
|
||||
# and then proceed to call `docker-finance` / `dfi` with your commands.
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
[ "$DOCKER_FINANCE_DEBUG" == true ] && set -xv
|
||||
[ "$DOCKER_FINANCE_DEBUG" == 2 ] && set -xv
|
||||
|
||||
# If not yet installed, gracefully exit
|
||||
if ! hash docker &>/dev/null; then
|
||||
|
||||
@@ -161,7 +161,7 @@ function main()
|
||||
lib_docker::docker "$@" || lib_utils::die_usage "$_usage"
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
[ "$DOCKER_FINANCE_DEBUG" == true ] && set -xv
|
||||
[ "$DOCKER_FINANCE_DEBUG" == 2 ] && set -xv
|
||||
|
||||
#
|
||||
# Command facade
|
||||
|
||||
Reference in New Issue
Block a user