【Shell】公共类-logger
#!/bin/bash function debug() { date=`date +%Y/%m/%d-%H:%M:%S` #echo -e "[DEBUG]\t${date} "········ "$*" echo -e "\033[37m[DEBUG]\t${date} "··· "\033[0m\033[37m$*\033[0m" } function info() { date=`date +%Y/%m/%d-%H:%M:%S` #echo -e "[INFO]\t${date} "········ "$*" echo -e "\033[32m[INFO]\t${date} "··· "\033[0m\033[32m$*\033[0m" } function warn() { date=`date +%Y/%m/%d-%H:%M:%S` #echo -e "[WARN]\t${date} "········ "$*" echo -e "\033[33m[WARN]\t${date} "··· "\033[0m\033[33m$*\033[0m" } function error() { date=`date +%Y/%m/%d-%H:%M:%S` #echo -e "[ERROR]\t${date} "··· "$*" echo -e "\033[31m[ERROR]\t${date} "··· "\033[0m\033[31m$*\033[0m" } debug "this is a debug string" info "this is a test string" error "this is a error info"
相关推荐
zhangjie 2020-11-11
步知道 2020-10-27
tufeiax 2020-09-03
85251846 2020-09-14
klarclm 2020-06-13
清风徐来水波不兴 2020-06-09
九天银河技术 2020-11-11
Crazyshark 2020-11-13
李轮清 2020-09-15
wangpaiyonghu 2020-06-28
jackalwb 2020-06-14
yhljxy 2020-06-14
myveer 2020-06-14
xiaobaif 2020-06-14
songshijiazuaa 2020-06-13
TMD咯MySQL 2020-06-12
archive 2020-06-12