From 5a22e78b8d1ce86817fcb9b8cb85f1e6c18eae2d Mon Sep 17 00:00:00 2001 From: XargonWan Date: Mon, 20 Jan 2025 12:12:58 +0900 Subject: [PATCH] LOGGER: removing some error outputs with conditinals --- functions/logger.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/logger.sh b/functions/logger.sh index 285dfe2c..6f436dc6 100755 --- a/functions/logger.sh +++ b/functions/logger.sh @@ -92,6 +92,9 @@ log() { # Write the log message to the log file if [ ! -f "$logfile" ]; then #echo "$timestamp [WARN] Log file not found in \"$logfile\", creating it" >&2 # Disabled it as it's always appearing because of log rotation + if [[ ! -d "$(dirname "$logfile")" ]]; then + mkdir -p "$(dirname "$logfile")" + fi touch "$logfile" fi echo "$log_message" >> "$logfile"