summaryrefslogtreecommitdiffhomepage
path: root/subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2019-01-19 02:41:17 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2019-01-19 02:45:52 +0000
commit584601a2612afce6a0f7670b192e57391f0ae859 (patch)
tree327bdd9443102edb885e92a24e52fb34c0501953 /subr
parent0eaee4ebe96cb25601d8a4ea79bd475240c8fdf0 (diff)
downloadmidipix_build-584601a2612afce6a0f7670b192e57391f0ae859.tar.bz2
midipix_build-584601a2612afce6a0f7670b192e57391f0ae859.tar.xz
etc/{build.usage,README}: fix typo.
subr/ex_rtl_log.subr:ex_rtl_log_msg(): minor cleanup.
Diffstat (limited to 'subr')
-rw-r--r--subr/ex_rtl_log.subr16
1 files changed, 3 insertions, 13 deletions
diff --git a/subr/ex_rtl_log.subr b/subr/ex_rtl_log.subr
index 108e90ab..e7d9ef3d 100644
--- a/subr/ex_rtl_log.subr
+++ b/subr/ex_rtl_log.subr
@@ -33,7 +33,7 @@ ex_rtl_log_set_vnfo_lvl() {
};
ex_rtl_log_msg() {
- local _lvl="${1}" _attr=""; shift;
+ local _lvl="${1}" _lvl_uc="" _attr=""; shift;
if [ "${_lvl}" = vnfo ]\
|| [ "${_lvl}" = vucc ]\
&& [ "${EXP_RTL_LOG_VNFO_LVL:-0}" -lt 1 ]; then
@@ -45,18 +45,8 @@ ex_rtl_log_msg() {
&& [ "${EXP_RTL_LOG_VNFO_LVL:-0}" -lt 3 ]; then
return;
fi;
- case "${_lvl}" in
- failexit) _attr="${DEFAULT_LOG_MSG_FAIL_COLOUR}"; ;;
- fail) _attr="${DEFAULT_LOG_MSG_FAIL_COLOUR}"; ;;
- info) _attr="${DEFAULT_LOG_MSG_INFO_COLOUR}"; ;;
- inf2) _attr="${DEFAULT_LOG_MSG_INF2_COLOUR}"; ;;
- vnfo) _attr="${DEFAULT_LOG_MSG_VNFO_COLOUR}"; ;;
- vvfo) _attr="${DEFAULT_LOG_MSG_VVFO_COLOUR}"; ;;
- vvvo) _attr="${DEFAULT_LOG_MSG_VVVO_COLOUR}"; ;;
- succ) _attr="${DEFAULT_LOG_MSG_SUCC_COLOUR}"; ;;
- suc2) _attr="${DEFAULT_LOG_MSG_SUC2_COLOUR}"; ;;
- vucc) _attr="${DEFAULT_LOG_MSG_VUCC_COLOUR}"; ;;
- esac;
+ _lvl_uc="$(ex_rtl_toupper "${_lvl%exit}")";
+ _attr="$(ex_rtl_get_var_unsafe "DEFAULT_LOG_MSG_${_lvl_uc}_COLOUR")";
if [ ${#} -gt 1 ]; then
exp_rtl_log_printf "${_attrs}" "==> %s %s %s" "$(ex_rtl_date)" "${1}" "$*";
else