feat(logger): Handle plain-text insufficient information
Return without logging if message, level and/or status is not supplied.
This commit is contained in:
@@ -14,8 +14,8 @@ uppercase() {
|
|||||||
|
|
||||||
# modified syslog fmt: <ISO-8601 timestamp> <hostname> <tag>[pid]: [LEVEL:$2] [STATUS:$3] <MESSAGE:$1> (<OPERATION:$4>:<CODE:$5>)
|
# modified syslog fmt: <ISO-8601 timestamp> <hostname> <tag>[pid]: [LEVEL:$2] [STATUS:$3] <MESSAGE:$1> (<OPERATION:$4>:<CODE:$5>)
|
||||||
writePlainTextLog() {
|
writePlainTextLog() {
|
||||||
# if no message is supplied, there is no purpose in generating a log message!
|
# not enough information to generate a meaningful log message
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ] || [ $# -lt 3 ]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user