Browse Source

Begin zui trans.

Joachim M. Giæver 2 years ago
parent
commit
be90767ae2
2 changed files with 25 additions and 0 deletions
  1. 0 0
      snap/snapcraft.yaml
  2. 25 0
      src/bin/logs-observe

File diff suppressed because it is too large
+ 0 - 0
snap/snapcraft.yaml


+ 25 - 0
src/bin/logs-observe

@@ -0,0 +1,25 @@
+#!/usr/bin/bash
+
+ZJS_LOGGING_TO_FILE="$(jq '.zwave.logToFile' -r ${SNAP_DATA}/settings.json)"
+Z2M_LOGGING_TO_FILE="$(jq '.gateway.logToFile' -r ${SNAP_DATA}/settings.json)"
+
+echo "${Z2M_LOGGING_TO_FILE}"
+echo "${ZJS_LOGGING_TO_FILE}"
+
+Z2M_LOG=
+ZJS_LOG=
+
+if [ "${Z2M_LOGGING_TO_FILE}" != true ]; then
+	Z2M_LOG="tail -f $(ls $SNAP_DATA/logs/zwavejs2mqtt_* | tail -1)"
+else
+	Z2M_LOG="tail -f /var/log/syslog | grep zwavejs2mqtt | sed -E 's/.*(]|m):/ZWAVE2MQTT/'"
+fi
+
+if [ "${ZJS_LOGGING_TO_FILE}" == true ]; then
+	ZJS_LOG="tail -f ${SNAP_DATA}/logs/zwavejs_current.log"
+fi
+
+echo "${Z2M_LOG}"
+echo "${ZJS_LOG}"
+
+#{ tail -f /var/log/syslog | grep zwavejs2mqtt | sed -E 's/.*(]|m):/ZWAVE2MQTT/' & tail -f $SNAP_DATA/logs/zwavejs_current.log; }

Some files were not shown because too many files changed in this diff