From 784224f4e7696dea43492852e6d205b6afcd4594 Mon Sep 17 00:00:00 2001 From: mboelen Date: Thu, 24 Sep 2015 21:40:54 +0200 Subject: [PATCH] Uniform way of saving warnings and suggestions to the log for later parsing --- include/functions | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/functions b/include/functions index a2cc73d8..ae4b75ed 100644 --- a/include/functions +++ b/include/functions @@ -1264,8 +1264,10 @@ # Old style # if [ "$2" = "L" -o "$2" = "M" -o "$2" = "H" ]; then - report "warning[]=$1|$3|" - logtext "Warning: $3 [$1]" + DETAILS="$2" + MESSAGE="$3" + TEST="$1" + SOLUTION="-" else # New style warning format: #
@@ -1281,9 +1283,10 @@ if [ "$2" = "" ]; then MESSAGE="UNKNOWN"; else MESSAGE="$2"; fi if [ "$3" = "" ]; then DETAILS="-"; else DETAILS="$3"; fi if [ "$4" = "" ]; then SOLUTION="-"; else SOLUTION="$4"; fi - report "warning[]=${TEST}|${MESSAGE}|${DETAILS}|${SOLUTION}|" - logtext "Warning: ${MESSAGE} [test:$1] [details:${DETAILS}] [solution:${SOLUTION}]" fi + report "warning[]=${TEST}|${MESSAGE}|${DETAILS}|${SOLUTION}|" + logtext "Warning: ${MESSAGE} [test:${TEST}] [details:${DETAILS}] [solution:${SOLUTION}]" + } SafePerms()