LOGGER: removing some error outputs with conditinals

This commit is contained in:
XargonWan 2025-01-20 12:12:58 +09:00
parent 3bee4f58fc
commit 5a22e78b8d

View file

@ -92,6 +92,9 @@ log() {
# Write the log message to the log file # Write the log message to the log file
if [ ! -f "$logfile" ]; then 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 #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" touch "$logfile"
fi fi
echo "$log_message" >> "$logfile" echo "$log_message" >> "$logfile"