Compare commits
2 Commits
abc7c279f8
...
035c7cfabb
Author | SHA1 | Date | |
---|---|---|---|
|
035c7cfabb | ||
|
d7530f6914 |
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
### Get Logwatch detail level
|
### Get Logwatch detail level (default to 0)
|
||||||
my $detailLevel = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
|
my $detailLevel = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,8 +97,11 @@ function quit {
|
|||||||
echo -e "${warn}${scriptName} generated the following warnings:" \
|
echo -e "${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
|
||||||
@ -111,8 +114,10 @@ function quit {
|
|||||||
echo -e "${err}${scriptName} generated the following errors:" \
|
echo -e "${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