Formatting

This commit is contained in:
2026-02-27 20:38:04 -06:00
parent e7d29c77b0
commit e6f55965d8
3 changed files with 121 additions and 118 deletions

View File

@@ -7,17 +7,16 @@ touch "$LOG_FILE"
touch "$ERROR_FILE"
log_to_file() {
printf "%s\n" "$1" >> "$LOG_FILE"
printf "%s\n" "$1" >>"$LOG_FILE"
}
# Subscribe and wait for log entries
mosquitto_sub -h 127.0.0.1 -t "$LOG_TOPIC" | while read -r line
do
# The line will look like: SaveLog=[2026-...] [INFO] ...
# We strip the "SaveLog=" prefix
msg_content="${line#SaveLog=}"
if [ -n "$msg_content" ]; then
log_to_file "$msg_content"
fi
mosquitto_sub -h 127.0.0.1 -t "$LOG_TOPIC" | while read -r line; do
# The line will look like: SaveLog=[2026-...] [INFO] ...
# We strip the "SaveLog=" prefix
msg_content="${line#SaveLog=}"
if [ -n "$msg_content" ]; then
log_to_file "$msg_content"
fi
done