参考 : https://www.jb51.net/article/141286.htm
function info(){
DATE_N=`date "+%Y-%m-%d %H:%M:%S.%N" | cut -b 1-23`
echo -e "$DATE_N|INFO|$@ "
}
function warning(){
DATE_N=`date "+%Y-%m-%d %H:%M:%S.%N" | cut -b 1-23`
echo -e "\033[33m$DATE_N|WARINIG|$@ \033[0m"
}
function success(){
DATE_N=`date "+%Y-%m-%d %H:%M:%S.%N" | cut -b 1-23`
echo -e "\033[32m$DATE_N|SUCCESS|$@ \033[0m"
}
function error(){
DATE_N=`date "+%Y-%m-%d %H:%M:%S.%N" | cut -b 1-23`
echo -e "\033[31m$DATE_N|ERROR|$@ \033[0m"
}