[params] Create journal logging switch
Create boolean variable to store journal logging preference. Set to 'false' by default. Add parameter to activate this preference. Update help to include this new parameter.
This commit is contained in:
@@ -157,6 +157,10 @@ scriptHelp() {
|
||||
textBlock "Switch value. Output log to console (stdout) instead of a log file. Can be combined with --nc if desired."
|
||||
textBlockDefaults "(disabled: output to log file)"
|
||||
newline
|
||||
textBlockSwitches "--log-journal"
|
||||
textBlock "Switch value. Output a structured log entry to your journaling system instead of a log file. Implies --nc."
|
||||
textBlockDefaults "(disabled: output to log file)"
|
||||
newline
|
||||
textBlockSwitches "--no-log"
|
||||
textBlock "Switch value. Do not create a log (i.e. no console, no file). You will not have *any* output from the script if you choose this option, so you will not know if updates succeeded or failed."
|
||||
textBlockDefaults "(disabled: output to log file)"
|
||||
@@ -253,6 +257,7 @@ writeLog() {
|
||||
scriptPath="$(CDPATH='' \cd -- "$(dirname -- "$0")" && pwd -P)"
|
||||
scriptName="$(basename "$0")"
|
||||
logFile="$scriptPath/${scriptName%.*}.log"
|
||||
logToJournal=0
|
||||
accountFile="$scriptPath/cloudflare.credentials"
|
||||
colourizeLogFile=1
|
||||
dnsRecords=""
|
||||
@@ -292,6 +297,10 @@ while [ $# -gt 0 ]; do
|
||||
# log to the console instead of a file
|
||||
logFile="/dev/stdout"
|
||||
;;
|
||||
--log-journal)
|
||||
# log to the journal system instead of a file
|
||||
logToJournal=1
|
||||
;;
|
||||
--no-log)
|
||||
# do not log anything
|
||||
logFile="/dev/null"
|
||||
|
||||
Reference in New Issue
Block a user