From 584601a2612afce6a0f7670b192e57391f0ae859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 19 Jan 2019 02:41:17 +0000 Subject: etc/{build.usage,README}: fix typo. subr/ex_rtl_log.subr:ex_rtl_log_msg(): minor cleanup. --- subr/ex_rtl_log.subr | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'subr') 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 -- cgit v1.2.3