feat(params): Add debug logging toggle

This commit is contained in:
2026-07-24 01:13:40 -06:00
parent 2b0128d0c1
commit fca36ac119
+9
View File
@@ -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." 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)" textBlockDefaults "(disabled: use file-based logging)"
newline 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" 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'." 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)" textBlockDefaults "(enabled)"
@@ -231,6 +235,7 @@ scriptPath="$(CDPATH='' \cd -- "$(dirname -- "$0")" && pwd -P)"
scriptName="$(basename "$0")" scriptName="$(basename "$0")"
logFile="$scriptPath/${scriptName%.*}.log" logFile="$scriptPath/${scriptName%.*}.log"
logToJournal=0 logToJournal=0
logDebug=0
useJsonLogFmt=1 useJsonLogFmt=1
useSyslogLogFmt=0 useSyslogLogFmt=0
accountFile="$scriptPath/cloudflare.credentials" accountFile="$scriptPath/cloudflare.credentials"
@@ -280,6 +285,10 @@ while [ $# -gt 0 ]; do
# do not log anything # do not log anything
logFile="/dev/null" logFile="/dev/null"
;; ;;
--log-debug)
# log debugging messages
logDebug=1
;;
--fmt-json) --fmt-json)
# use JSON log formatting # use JSON log formatting
useJsonLogFmt=1 useJsonLogFmt=1