From fca36ac119549c54305919103833c812ccd50340 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 24 Jul 2026 01:13:40 -0600 Subject: [PATCH] feat(params): Add debug logging toggle --- cfddns.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cfddns.sh b/cfddns.sh index 960e63d..206b5b0 100644 --- a/cfddns.sh +++ b/cfddns.sh @@ -175,6 +175,10 @@ scriptHelp() { textBlock "Switch value. Script will not log anything. You will not have *any* output from the script if you choose this option, so you will not know if updates succeed or fail." textBlockDefaults "(disabled: use file-based logging)" newline + textBlockSwitches "--log-debug" + textBlock "Switch value. Log 'debug' level messages. This should normally remain disabled." + textBlockDefaults "(disabled: do not log 'debug' messages)" + newline textBlockSwitches "--fmt-json" textBlock "Switch value. Use JSON formatted key-value pair structured logging format. Best when using a log parsing tool or log management system to read your log files. Does not apply when using '--log-journal'." textBlockDefaults "(enabled)" @@ -231,6 +235,7 @@ scriptPath="$(CDPATH='' \cd -- "$(dirname -- "$0")" && pwd -P)" scriptName="$(basename "$0")" logFile="$scriptPath/${scriptName%.*}.log" logToJournal=0 +logDebug=0 useJsonLogFmt=1 useSyslogLogFmt=0 accountFile="$scriptPath/cloudflare.credentials" @@ -280,6 +285,10 @@ while [ $# -gt 0 ]; do # do not log anything logFile="/dev/null" ;; + --log-debug) + # log debugging messages + logDebug=1 + ;; --fmt-json) # use JSON log formatting useJsonLogFmt=1