fix logger
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-05-21 18:27:33 +02:00
parent b36f0d0dff
commit 50a788ab5c
Signed by: deblan
GPG key ID: 579388D585F70417

19
script
View file

@ -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;;