This commit is contained in:
parent
b36f0d0dff
commit
50a788ab5c
19
script
19
script
|
@ -46,6 +46,7 @@ main() {
|
|||
}
|
||||
|
||||
log() {
|
||||
LOG_VERBOSE="${LOG_VERBOSE:-info}"
|
||||
LEVEL=info
|
||||
TIME=
|
||||
|
||||
|
@ -59,15 +60,21 @@ log() {
|
|||
|
||||
if [ -t 2 ] && [ -z "${NO_COLOR-}" ]; then
|
||||
case "${LEVEL}" in
|
||||
debug) COLOR="$(tput setaf 3)"; LEVEL=100;;
|
||||
notice) COLOR="$(tput setaf 4)"; LEVEL=250;;
|
||||
warning) COLOR="$(tput setaf 5)"; LEVEL=300;;
|
||||
error) COLOR="$(tput setaf 1)"; LEVEL=400;;
|
||||
*) COLOR="$(tput sgr0)"; LEVEL=200;;
|
||||
debug) COLOR="$(tput setaf 3)";;
|
||||
notice) COLOR="$(tput setaf 4)";;
|
||||
warning) COLOR="$(tput setaf 5)";;
|
||||
error) COLOR="$(tput setaf 1)";;
|
||||
*) COLOR="$(tput sgr0)";;
|
||||
esac
|
||||
fi
|
||||
|
||||
LOG_VERBOSE="${LOG_VERBOSE:-info}"
|
||||
case "${LEVEL}" in
|
||||
debug) LEVEL=100;;
|
||||
notice) LEVEL=250;;
|
||||
warning) LEVEL=300;;
|
||||
error) LEVEL=400;;
|
||||
*) LEVEL=200;;
|
||||
esac
|
||||
|
||||
case "${LOG_VERBOSE}" in
|
||||
debug) LOG_VERBOSE_VALUE=100;;
|
||||
|
|
Loading…
Reference in a new issue