Skip to content

Commit

Permalink
[lib-common] change log color to case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
shizunge committed Sep 13, 2024
1 parent 24bc7b7 commit 3b19f9c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ _level_color() {
local ORANGE='\033[0;33m'
local GREEN='\033[0;32m'
local BLUE='\033[0;34m'
[ "${LEVEL}" = "DEBUG" ] && echo "${BLUE}" && return 0
[ "${LEVEL}" = "INFO" ] && echo "${GREEN}" && return 0;
[ "${LEVEL}" = "WARN" ] && echo "${ORANGE}" && return 0;
[ "${LEVEL}" = "ERROR" ] && echo "${RED}" && return 0;
echo "${LEVEL}" | grep -q -i "^DEBUG$" && echo "${BLUE}" && return 0;
echo "${LEVEL}" | grep -q -i "^INFO$" && echo "${GREEN}" && return 0;
echo "${LEVEL}" | grep -q -i "^WARN$" && echo "${ORANGE}" && return 0;
echo "${LEVEL}" | grep -q -i "^ERROR$" && echo "${RED}" && return 0;
echo "${NO_COLOR}"
}

Expand Down

0 comments on commit 3b19f9c

Please sign in to comment.