Blame SOURCES/bz720543-pcmk-crm_report_record_the_output_of_the_collector.patch

ed0026
commit c3fb9d983fbbcc7f19908c384cd29656e0620ec3
ed0026
Author: Andrew Beekhof <andrew@beekhof.net>
ed0026
Date:   Wed Sep 4 12:54:37 2013 +1000
ed0026
ed0026
    Feature: crm_report: Record the output of the collector
ed0026
    
ed0026
    (cherry picked from commit 494a01897f07327ec475a86957b8fc7fd3ad362c)
ed0026
ed0026
diff --git a/tools/report.common.in b/tools/report.common.in
ed0026
index c4023a8..9742f1c 100644
ed0026
--- a/tools/report.common.in
ed0026
+++ b/tools/report.common.in
ed0026
@@ -72,15 +72,29 @@ glibc
ed0026
 #
ed0026
 # keep the user posted
ed0026
 #
ed0026
+record() {
ed0026
+    if [ x != x"$REPORT_HOME" -a -d "${REPORT_HOME}/$shorthost" ]; then
ed0026
+        rec="${REPORT_HOME}/$shorthost/report.out"
ed0026
+
ed0026
+    elif [ x != x"${l_base}" ]; then
ed0026
+        rec="${l_base}/report.summary"
ed0026
+
ed0026
+    else
ed0026
+        rec="/dev/null"
ed0026
+    fi
ed0026
+    printf "%-10s  $*\n" "$shorthost:" 2>&1 >> "${rec}"
ed0026
+}
ed0026
 
ed0026
 log() {
ed0026
     printf "%-10s  $*\n" "$shorthost:" 1>&2
ed0026
+    record "$*"
ed0026
 }
ed0026
 
ed0026
 debug() {
ed0026
     if [ $verbose -gt 0 ]; then
ed0026
 	log "Debug: $*"
ed0026
     fi
ed0026
+    record "Debug: $*"
ed0026
 }
ed0026
 
ed0026
 info() {