fix: only print colored timestamp and message when stdout is a terminal

This commit is contained in:
Andrey Petelin
2026-01-23 13:59:26 +03:00
parent fc2d4ee976
commit 92f14cd15b
+3 -1
View File
@@ -18,7 +18,9 @@ nolog() {
local timestamp
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
echo -e "${COLOR_CYAN}[$timestamp]${COLOR_RESET} ${COLOR_GREEN}$message${COLOR_RESET}"
if [ -t 1 ]; then
echo -e "${COLOR_CYAN}[$timestamp]${COLOR_RESET} ${COLOR_GREEN}$message${COLOR_RESET}"
fi
}
echolog() {