mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-01-27 04:40:37 +03:00
fix: only print colored timestamp and message when stdout is a terminal
This commit is contained in:
@@ -18,7 +18,9 @@ nolog() {
|
|||||||
local timestamp
|
local timestamp
|
||||||
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
|
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() {
|
echolog() {
|
||||||
|
|||||||
Reference in New Issue
Block a user