refactor(logger): Rename writeJournalLog function
Rename from 'writeJournalLog' to 'writeJournalDLog' for specificity.
This commit is contained in:
@@ -102,7 +102,7 @@ writeJsonLog() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# $1: message, $2: level, $3: status, $4: operation, $5: code
|
# $1: message, $2: level, $3: status, $4: operation, $5: code
|
||||||
writeJournalLog() {
|
writeJournalDLog() {
|
||||||
# translate error levels
|
# translate error levels
|
||||||
if [ -z "$2" ]; then
|
if [ -z "$2" ]; then
|
||||||
LOG_LEVEL=1
|
LOG_LEVEL=1
|
||||||
@@ -179,11 +179,11 @@ if [ "$1" = "json" ]; then
|
|||||||
writeJsonLog "This is a test message" "error" "testing" # generate this message at the 'error' level, part of a 'test' operation, and with the default code
|
writeJsonLog "This is a test message" "error" "testing" # generate this message at the 'error' level, part of a 'test' operation, and with the default code
|
||||||
writeJsonLog "This is a test message" "alert" "testing" 10 # generate this message at the 'alert' level with all parameters set
|
writeJsonLog "This is a test message" "alert" "testing" 10 # generate this message at the 'alert' level with all parameters set
|
||||||
elif [ "$1" = "journal" ]; then
|
elif [ "$1" = "journal" ]; then
|
||||||
writeJournalLog # this will generate a generic error message
|
writeJournalDLog # this will generate a generic error message
|
||||||
writeJournalLog "This is a test message" # generate this message at the default level with the default code
|
writeJournalDLog "This is a test message" # generate this message at the default level with the default code
|
||||||
writeJournalLog "This is a test message" "warning" # generate this message at the 'warning' level with the default code
|
writeJournalDLog "This is a test message" "warning" # generate this message at the 'warning' level with the default code
|
||||||
writeJournalLog "This is a test message" "error" "testing" # generate this message at the 'error' level as part of a 'test' operation, and with the default code
|
writeJournalDLog "This is a test message" "error" "testing" # generate this message at the 'error' level as part of a 'test' operation, and with the default code
|
||||||
writeJournalLog "This is a test message" "alert" "testing" 10 # generate this message at the 'alert' level with all parameters set
|
writeJournalDLog "This is a test message" "alert" "testing" 10 # generate this message at the 'alert' level with all parameters set
|
||||||
else
|
else
|
||||||
printf "\nPlease specify either 'json' or 'journal' after the script name. Exiting.\n\n"
|
printf "\nPlease specify either 'json' or 'journal' after the script name. Exiting.\n\n"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user