From 979f666fc1c8cd6d7f17c6211c9850c3fa4e2911 Mon Sep 17 00:00:00 2001 From: Alessandro Pirastru Date: Thu, 24 Apr 2025 18:42:46 +0200 Subject: [PATCH] feat: Enhance log functions with ANSI color formatting - Added ANSI escape codes for improved log styling: light blue for info, orange for warnings, and red for errors. - Updated all log functions (`info`, `warn`, `fatal`) to include bold and colored output. Signed-off-by: Alessandro Pirastru --- docs/static/install.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/static/install.sh b/docs/static/install.sh index 1cefe7f2..5111f8ae 100644 --- a/docs/static/install.sh +++ b/docs/static/install.sh @@ -31,19 +31,26 @@ set -o noglob #set -x # --- helper functions for logs --- +# ANSI escape codes +LIGHT_BLUE='\033[38;5;117m' +ORANGE='\033[38;5;214m' +RED='\033[38;5;196m' +BOLD='\033[1m' +RESET='\033[0m' + info() { - echo ' ' "$@" + echo -e "${BOLD}${LIGHT_BLUE}" '[INFO] ' "$@" "${RESET}" } warn() { - echo '[WARN] ' "$@" >&2 + echo -e "${BOLD}${ORANGE}" '[WARN] ' "$@" "${RESET}" >&2 } fatal() { - echo '[ERROR] ' "$@" >&2 + echo -e "${BOLD}${RED}" '[ERROR] ' "$@" "${RESET}" >&2 exit 1 }