feat(params): Add debug logging toggle
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user