From 48cb270a926f22b585394dc344d75962d16409a6 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Thu, 21 Mar 2024 14:49:37 +0800 Subject: [PATCH] Optimizing scripts --- scripts/lib/logging.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/lib/logging.sh b/scripts/lib/logging.sh index 4cabc1a78..0d15463eb 100755 --- a/scripts/lib/logging.sh +++ b/scripts/lib/logging.sh @@ -210,11 +210,26 @@ openim::log::status() { if [[ ${OPENIM_VERBOSE} < ${V} ]]; then return fi - timestamp=$(date +"[%Y-%m-%d %H:%M:%S %Z]") - echo_log -e "${COLOR_BLUE}${timestamp} ${1} ${COLOR_BLUE}$@${reset_color}" + + local COLOR_BLUE="\033[0;34m" + local COLOR_RESET="\033[0m" + + local timestamp=$(date +"[%Y-%m-%d %H:%M:%S %Z]") + + echo_log() { + echo -e "$@" + } + + + echo_log "${COLOR_BLUE}${timestamp} ${1}${COLOR_RESET}" + shift + for message; do + echo_log "${COLOR_BLUE}${message}${COLOR_RESET}" + done } + openim::log::success() { local V="${V:-0}" if [[ ${OPENIM_VERBOSE} < ${V} ]]; then @@ -227,7 +242,6 @@ openim::log::success() { - function openim::log::test_log() { echo_log "test log" openim::log::info "openim::log::info"