From 36f79547d693e6458ce1bac6c46fd741b04225ac Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Thu, 18 Dec 2025 14:21:37 +0100 Subject: [PATCH] refactor: separate log output to stdout and file, gracefully handling file write failures. --- demo/capture-upload.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demo/capture-upload.sh b/demo/capture-upload.sh index 356e7c1..cf37912 100644 --- a/demo/capture-upload.sh +++ b/demo/capture-upload.sh @@ -45,7 +45,9 @@ RETRY_DELAY="${RETRY_DELAY:-5}" log() { local timestamp 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() {