]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: use cout instead of cerr in journal tool 2360/head
authorJohn Spray <john.spray@redhat.com>
Fri, 29 Aug 2014 17:34:39 +0000 (18:34 +0100)
committerJohn Spray <john.spray@redhat.com>
Fri, 29 Aug 2014 17:34:39 +0000 (18:34 +0100)
Aside from being a bit odd to begin with, using stderr
was causing tests to fail because the output was polluted
by log output which is also on stderr.

Fixes: 9281
Signed-off-by: John Spray <john.spray@redhat.com>
qa/workunits/suites/cephfs_journal_tool_smoke.sh
src/tools/cephfs/EventOutput.cc

index fddcf2e2d9ef0529365ec3ad86c89ed1557a93e7..fe9b60ab57e4b914c536c1330554140aa32ad94b 100755 (executable)
@@ -17,11 +17,11 @@ fi
 # following checks.
 echo "Testing that export/import cycle preserves state"
 HEADER_STATE=`$BIN header get`
-EVENT_LIST=`$BIN event get list 2>&1`
+EVENT_LIST=`$BIN event get list`
 $BIN journal export $JOURNAL_FILE
 $BIN journal import $JOURNAL_FILE
 NEW_HEADER_STATE=`$BIN header get`
-NEW_EVENT_LIST=`$BIN event get list 2>&1`
+NEW_EVENT_LIST=`$BIN event get list`
 
 if [ ! "$HEADER_STATE" = "$NEW_HEADER_STATE" ] ; then
     echo "Import failed to preserve header state"
index e5cbf2478716d0354030909e1396c0e665e18523..6af9497fd4fddbfd547063ae0e0d6d9c0263383d 100644 (file)
@@ -95,12 +95,12 @@ void EventOutput::list() const
       detail = eu->type;
     }
 
-    std::cerr << "0x"
+    std::cout << "0x"
       << std::hex << i->first << std::dec << " "
       << i->second.log_event->get_type_str() << ": "
       << " (" << detail << ")" << std::endl;
     for (std::vector<std::string>::iterator i = ev_paths.begin(); i != ev_paths.end(); ++i) {
-        std::cerr << "  " << *i << std::endl;
+        std::cout << "  " << *i << std::endl;
     }
   }
 }
@@ -116,8 +116,8 @@ void EventOutput::summary() const
     type_count[type] += 1;
   }
 
-  std::cerr << "Events by type:" << std::endl;
+  std::cout << "Events by type:" << std::endl;
   for (std::map<std::string, int>::iterator i = type_count.begin(); i != type_count.end(); ++i) {
-      std::cerr << "  " << i->first << ": " << i->second << std::endl;
+      std::cout << "  " << i->first << ": " << i->second << std::endl;
   }
 }