From 60a82354e128ea102f0f838127ee5cc05a003df8 Mon Sep 17 00:00:00 2001 From: Gilles Grandou Date: Mon, 5 Sep 2022 09:06:47 +0200 Subject: [PATCH] follow_log to dump and follow script related log entries --- follow_log | 5 +++++ shelly.conf.example | 3 +++ shelly_log | 2 -- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 follow_log diff --git a/follow_log b/follow_log new file mode 100755 index 0000000..401a0f4 --- /dev/null +++ b/follow_log @@ -0,0 +1,5 @@ +#!/bin/bash + +source $(dirname $0)/shelly.conf + +tail -n+0 -f $LOGFILE |egrep -i 'POOL|script' diff --git a/shelly.conf.example b/shelly.conf.example index b112e21..8957652 100644 --- a/shelly.conf.example +++ b/shelly.conf.example @@ -12,6 +12,9 @@ SCRIPT_NAME="pool" SCRIPT_FILENAME="pool.js" SCRIPT_ID=1 +# debug log file +LOGFILE=$ROOT_DIR/$SHELLY_HOST.log + # UDP port on which listen for debug messages # (to be configured on your shelly device) UDP_LOG_PORT=6901 diff --git a/shelly_log b/shelly_log index cd2815a..eb9efaa 100755 --- a/shelly_log +++ b/shelly_log @@ -2,8 +2,6 @@ source $(dirname $0)/shelly.conf -LOGFILE=$SHELLY_HOST.log - while true; do echo -e "\n======================================================================\n" | tee -a ${LOGFILE} nc -u -k -l $UDP_LOG_PORT | tee -a ${LOGFILE}