refactor: separate log output to stdout and file, gracefully handling file write failures.

This commit is contained in:
sebseb7
2025-12-18 14:21:37 +01:00
parent a8e1da9559
commit 36f79547d6

View File

@@ -45,7 +45,9 @@ RETRY_DELAY="${RETRY_DELAY:-5}"
log() { log() {
local timestamp local timestamp
timestamp=$(date '+%Y-%m-%d %H:%M:%S') timestamp=$(date '+%Y-%m-%d %H:%M:%S')
echo "[$timestamp] $*" | tee -a "$LOG_FILE" 2>/dev/null || echo "[$timestamp] $*" local msg="[$timestamp] $*"
echo "$msg"
echo "$msg" >> "$LOG_FILE" 2>/dev/null || true
} }
log_error() { log_error() {