Skip to content

Commit 655314e

Browse files
authored
Merge pull request #11 from fullstack-devops/bugfix/logging
fix logging
2 parents ebd7824 + 0db699d commit 655314e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

docker-image/docker-entrypoint.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,29 @@ log() {
4949
local message="${2}" # msg to print
5050
local debug="${3}" # 0: only warn and error, >0: ok and info
5151

52+
local clr_ok="\033[0;32m"
53+
local clr_info="\033[0;34m"
54+
local clr_warn="\033[0;33m"
55+
local clr_err="\033[0;31m"
56+
local clr_rst="\033[0m"
57+
5258
if [ "${type}" = "ok" ]; then
5359
if [ "${debug}" -gt "0" ]; then
54-
echo "[OK] ${message}"
60+
printf "${clr_ok}[OK] %s${clr_rst}\n" "${message}" 1>&2
5561
fi
5662
elif [ "${type}" = "info" ]; then
5763
if [ "${debug}" -gt "0" ]; then
58-
echo "[INFO] ${message}"
64+
printf "${clr_info}[INFO] %s${clr_rst}\n" "${message}" 1>&2
5965
fi
6066
elif [ "${type}" = "warn" ]; then
61-
echo "[WARN] ${message}"
67+
printf "${clr_warn}[WARN] %s${clr_rst}\n" "${message}" 1>&2 # stdout -> stderr
6268
elif [ "${type}" = "err" ]; then
63-
echo "[ERR] ${message}"
69+
printf "${clr_err}[ERR] %s${clr_rst}\n" "${message}" 1>&2 # stdout -> stderr
6470
else
65-
echo "[???] ${message}"
71+
printf "${clr_err}[???] %s${clr_rst}\n" "${message}" 1>&2 # stdout -> stderr
6672
fi
6773
}
6874

69-
7075
###
7176
### Wrapper for run_run command
7277
###

helm/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ image:
1111
tag: ""
1212

1313
envValues:
14-
debug_entrypoint: "0"
14+
debug_entrypoint: "1"
1515
docker_logs: "0"
1616
wildcard_dns:
1717
extra_hosts:

0 commit comments

Comments
 (0)