diff --git a/script b/script index c17e88f..0a020ad 100755 --- a/script +++ b/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;;