|
@@ -28,14 +28,14 @@ destfile2=@abs_builddir@/destination_test_destfile_2_$$
|
|
|
|
|
|
passfail() {
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
- echo " -- pass"
|
|
|
+ echo " pass"
|
|
|
else
|
|
|
- echo " ** FAIL"
|
|
|
+ echo " FAIL"
|
|
|
failcount=`expr $failcount + $1`
|
|
|
fi
|
|
|
}
|
|
|
|
|
|
-echo "1. One logger, multiple destinations"
|
|
|
+echo "1. One logger, multiple destinations:"
|
|
|
cat > $tempfile << .
|
|
|
FATAL [example] MSG_WRITERR, error writing to test1: 42
|
|
|
ERROR [example] MSG_RDLOCMES, reading local message file dummy/file
|
|
@@ -44,12 +44,16 @@ ERROR [example.beta] MSG_BADDESTINATION, unrecognized log destination: beta_erro
|
|
|
.
|
|
|
rm -f $destfile1 $destfile2
|
|
|
./logger_example -s error -f $destfile1 -f $destfile2
|
|
|
+
|
|
|
+echo -n " - destination 1:"
|
|
|
cut -d' ' -f3- $destfile1 | diff $tempfile -
|
|
|
passfail $?
|
|
|
+
|
|
|
+echo -n " - destination 2:"
|
|
|
cut -d' ' -f3- $destfile2 | diff $tempfile -
|
|
|
passfail $?
|
|
|
|
|
|
-echo "2. Two loggers, different destinations and severities"
|
|
|
+echo "2. Two loggers, different destinations and severities"
|
|
|
rm -f $destfile1 $destfile2
|
|
|
./logger_example -l example -s info -f $destfile1 -l alpha -s warn -f $destfile2
|
|
|
|
|
@@ -65,9 +69,11 @@ ERROR [example.beta] MSG_BADDESTINATION, unrecognized log destination: beta_erro
|
|
|
WARN [example.beta] MSG_BADSTREAM, bad log console output stream: beta_warn
|
|
|
INFO [example.beta] MSG_READERR, error reading from message file beta: info
|
|
|
.
|
|
|
+echo -n " - destination 1:"
|
|
|
cut -d' ' -f3- $destfile1 | diff $tempfile -
|
|
|
passfail $?
|
|
|
|
|
|
+echo -n " - destination 2:"
|
|
|
cat > $tempfile << .
|
|
|
WARN [example.alpha] MSG_READERR, error reading from message file a.txt: dummy reason
|
|
|
.
|