From: John Spray Date: Fri, 29 Aug 2014 17:34:39 +0000 (+0100) Subject: tools: use cout instead of cerr in journal tool X-Git-Tag: v0.86~164^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9fc26840cf20cd548c9aecd36bbb4da624c3ca28;p=ceph.git tools: use cout instead of cerr in journal tool 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 --- diff --git a/qa/workunits/suites/cephfs_journal_tool_smoke.sh b/qa/workunits/suites/cephfs_journal_tool_smoke.sh index fddcf2e2d9ef..fe9b60ab57e4 100755 --- a/qa/workunits/suites/cephfs_journal_tool_smoke.sh +++ b/qa/workunits/suites/cephfs_journal_tool_smoke.sh @@ -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" diff --git a/src/tools/cephfs/EventOutput.cc b/src/tools/cephfs/EventOutput.cc index e5cbf2478716..6af9497fd4fd 100644 --- a/src/tools/cephfs/EventOutput.cc +++ b/src/tools/cephfs/EventOutput.cc @@ -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::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::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; } }