Changed warning and error exit reports to incorporate timestamps
This commit is contained in:
parent
deacdcd04e
commit
d6f48908b5
@ -105,11 +105,14 @@ function scriptHelp {
|
|||||||
function quit {
|
function quit {
|
||||||
# list generated warnings, if any
|
# list generated warnings, if any
|
||||||
if [ ${#exitWarn[@]} -gt 0 ]; then
|
if [ ${#exitWarn[@]} -gt 0 ]; then
|
||||||
echo -e "${warn}${scriptName} generated the following warnings:" \
|
echo -e "\n${warn}${scriptName} generated the following warnings:" \
|
||||||
"${normal}" >> "$logFile"
|
"${normal}" >> "$logFile"
|
||||||
for warnCode in "${exitWarn[@]}"; do
|
for warnCode in "${exitWarn[@]}"; do
|
||||||
echo -e "${warn}-- [WARNING] ${warningExplain[$warnCode]}" \
|
warnStamp="${warnCode%%_*}"
|
||||||
"(code: ${warnCode}) --${normal}" >> "$logFile"
|
warnValue="${warnCode##*_}"
|
||||||
|
echo -e "${warn}${warnStamp} -- [WARNING]" \
|
||||||
|
"${warningExplain[$warnValue]} (code: ${warnValue}) --" \
|
||||||
|
"${normal}" >> "$logFile"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ -z "${exitError}" ]; then
|
if [ -z "${exitError}" ]; then
|
||||||
@ -119,11 +122,13 @@ function quit {
|
|||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
# list generated errors and explanations then exit script with code 2
|
# list generated errors and explanations then exit script with code 2
|
||||||
echo -e "${err}${scriptName} generated the following errors:" \
|
echo -e "\n${err}${scriptName} generated the following errors:" \
|
||||||
"${normal}" >> "$logFile"
|
"${normal}" >> "$logFile"
|
||||||
for errCode in "${exitError[@]}"; do
|
for errCode in "${exitError[@]}"; do
|
||||||
echo -e "${err}-- [ERROR] ${errorExplain[$errCode]}" \
|
errStamp="${errCode%%_*}"
|
||||||
"(code: ${errCode}) --$normal" >> "$logFile"
|
errValue="${errCode##*_}"
|
||||||
|
echo -e "${err}${errStamp} -- [ERROR] ${errorExplain[$errValue]}" \
|
||||||
|
"(code: ${errValue}) --${normal}" >> "$logFile"
|
||||||
done
|
done
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user