Compare commits

...

2 Commits

Author SHA1 Message Date
Asif Bacchus 035c7cfabb Added stamping to warning and error display in quit function 2018-10-23 04:57:30 -06:00
Asif Bacchus d7530f6914 Added quick note about default 2018-10-23 04:50:37 -06:00
2 changed files with 10 additions and 5 deletions

View File

@ -11,7 +11,7 @@
use strict;
### Get Logwatch detail level
### Get Logwatch detail level (default to 0)
my $detailLevel = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;

View File

@ -97,8 +97,11 @@ function quit {
echo -e "${warn}${scriptName} generated the following warnings:" \
"${normal}" >> "$logFile"
for warnCode in "${exitWarn[@]}"; do
echo -e "${warn}-- [WARNING] ${warningExplain[$warnCode]}" \
"(code: ${warnCode}) --${normal}" >> "$logFile"
warnStamp="${warnCode%%_*}"
warnValue="${warnCode##*_}"
echo -e "${warn}${warnStamp} -- [WARNING]" \
"${warningExplain[$warnValue]} (code: ${warnValue}) --" \
"${normal}" >> "$logFile"
done
fi
if [ -z "${exitError}" ]; then
@ -111,8 +114,10 @@ function quit {
echo -e "${err}${scriptName} generated the following errors:" \
"${normal}" >> "$logFile"
for errCode in "${exitError[@]}"; do
echo -e "${err}-- [ERROR] ${errorExplain[$errCode]}" \
"(code: ${errCode}) --$normal" >> "$logFile"
errStamp="${errCode%%_*}"
errValue="${errCode##*_}"
echo -e "${err}${errStamp}-- [ERROR] ${errorExplain[$errValue]}" \
"(code: ${errValue}) --${normal}" >> "$logFile"
done
exit 2
fi