lib/display.sh: some cosmetics improvement

This commit is contained in:
levasseur
2021-06-01 15:07:49 +02:00
parent 50f4f40eff
commit 6e97296e25

View File

@@ -1,4 +1,5 @@
# Defines color codes (standard 16 colors display) # Some display functions and defines color codes
# (standard 16 colors display)
DEFAULTFG="\e[0;39m" DEFAULTFG="\e[0;39m"
DEFAULTBG="\e[0;49m" DEFAULTBG="\e[0;49m"
@@ -70,20 +71,20 @@ On_IWhite='\e[0;107m'
# Affiche le status avec en-tête coloré et timestamp # Affiche le status avec en-tête coloré et timestamp
# (valeur de $1 : I=info, W=warning, E=error, pas d'entête si différent) # (valeur de $1 : I=info, W=warning, E=error, pas d'entête si différent)
prnt() { prnt() {
case $1 in case $1 in
"I") "I")
HEADS="[ ${IGreen}info${DEFAULTFG} ]" HEADS="[ ${IGreen}info${DEFAULTFG} ]"
shift shift
;; ;;
"W") "W")
HEADS="[ ${IYellow}Attention${DEFAULTFG} ]" HEADS="[ ${IYellow}Attention${DEFAULTFG} ]"
shift shift
;; ;;
"E") "E")
HEADS="[ ${IRed}ERREUR${DEFAULTFG} ]" HEADS="[ ${IRed}ERREUR${DEFAULTFG} ]"
shift shift
;; ;;
esac esac
echo -e "${IWhite}$(date $DATEFORMAT)${DEFAULTFG} ${HEADS} $@" echo -e "${IWhite}$(date $DATEFORMAT)${DEFAULTFG} ${HEADS} $@"
} }
export -f prnt export -f prnt