mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-11 06:23:47 -05:00
Add NOTICE level logging
This commit is contained in:
@@ -176,6 +176,11 @@ _alert_() {
|
|||||||
_writeToLog_
|
_writeToLog_
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
NOTICE | notice | Notice)
|
||||||
|
if [[ ${alertType} =~ ^(die|error|fatal|warning|notice|success) ]]; then
|
||||||
|
_writeToLog_
|
||||||
|
fi
|
||||||
|
;;
|
||||||
WARN | warn | Warn)
|
WARN | warn | Warn)
|
||||||
if [[ ${alertType} =~ ^(die|error|fatal|warning) ]]; then
|
if [[ ${alertType} =~ ^(die|error|fatal|warning) ]]; then
|
||||||
_writeToLog_
|
_writeToLog_
|
||||||
@@ -413,7 +418,8 @@ _usage_() {
|
|||||||
|
|
||||||
${bold}Options:${reset}
|
${bold}Options:${reset}
|
||||||
-h, --help Display this help and exit
|
-h, --help Display this help and exit
|
||||||
--loglevel [LEVEL] One of: FATAL, ERROR, WARN, INFO, DEBUG, ALL, OFF (Default is 'ERROR')
|
--loglevel [LEVEL] One of: FATAL, ERROR, WARN, INFO, NOTICE, DEBUG, ALL, OFF
|
||||||
|
(Default is 'ERROR')
|
||||||
--logfile [FILE] Full PATH to logfile. (Default is '${HOME}/logs/$(basename "$0").log')
|
--logfile [FILE] Full PATH to logfile. (Default is '${HOME}/logs/$(basename "$0").log')
|
||||||
-n, --dryrun Non-destructive. Makes no permanent changes.
|
-n, --dryrun Non-destructive. Makes no permanent changes.
|
||||||
-q, --quiet Quiet (no output)
|
-q, --quiet Quiet (no output)
|
||||||
|
|||||||
@@ -137,6 +137,11 @@ _alert_() {
|
|||||||
_writeToLog_
|
_writeToLog_
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
NOTICE | notice | Notice)
|
||||||
|
if [[ ${alertType} =~ ^(die|error|fatal|warning|notice|success) ]]; then
|
||||||
|
_writeToLog_
|
||||||
|
fi
|
||||||
|
;;
|
||||||
WARN | warn | Warn)
|
WARN | warn | Warn)
|
||||||
if [[ ${alertType} =~ ^(die|error|fatal|warning) ]]; then
|
if [[ ${alertType} =~ ^(die|error|fatal|warning) ]]; then
|
||||||
_writeToLog_
|
_writeToLog_
|
||||||
|
|||||||
Reference in New Issue
Block a user