2015-05-29 13:42:34 +02:00
|
|
|
#!/bin/sh
|
2015-05-11 06:08:28 +02:00
|
|
|
bldred='\033[1;31m'
|
|
|
|
bldgrn='\033[1;32m'
|
|
|
|
bldblu='\033[1;34m'
|
|
|
|
bldylw='\033[1;33m' # Yellow
|
|
|
|
txtrst='\033[0m'
|
|
|
|
|
|
|
|
logit () {
|
2015-05-29 13:42:34 +02:00
|
|
|
printf "%b\n" "$1" | tee -a "$logger"
|
2015-05-11 06:08:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
info () {
|
2015-05-29 13:42:34 +02:00
|
|
|
printf "%b\n" "${bldblu}[INFO]${txtrst} $1" | tee -a "$logger"
|
2015-05-11 06:08:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
pass () {
|
2015-05-29 13:42:34 +02:00
|
|
|
printf "%b\n" "${bldgrn}[PASS]${txtrst} $1" | tee -a "$logger"
|
2015-05-11 06:08:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
warn () {
|
2015-05-29 13:42:34 +02:00
|
|
|
printf "%b\n" "${bldred}[WARN]${txtrst} $1" | tee -a "$logger"
|
2015-05-11 06:08:28 +02:00
|
|
|
}
|
|
|
|
|
2017-03-23 11:29:58 +01:00
|
|
|
note () {
|
|
|
|
printf "%b\n" "${bldylw}[NOTE]${txtrst} $1" | tee -a "$logger"
|
|
|
|
}
|
|
|
|
|
2015-05-11 06:08:28 +02:00
|
|
|
yell () {
|
2015-05-29 13:42:34 +02:00
|
|
|
printf "%b\n" "${bldylw}$1${txtrst}\n"
|
2015-05-11 06:08:28 +02:00
|
|
|
}
|
2017-10-10 13:54:59 +02:00
|
|
|
|
|
|
|
beginjson () {
|
|
|
|
printf "{\n \"start\": %s," "$1" | tee "$logger.json" 2>/dev/null 1>&2
|
|
|
|
}
|
|
|
|
|
|
|
|
endjson (){
|
|
|
|
printf "\n \"end\": %s \n}\n" "$1" | tee -a "$logger.json" 2>/dev/null 1>&2
|
|
|
|
}
|
|
|
|
|
|
|
|
logjson (){
|
|
|
|
printf "\n \"%s\": \"%s\"," "$1" "$2" | tee -a "$logger.json" 2>/dev/null 1>&2
|
|
|
|
}
|