From: Sage Weil Date: Fri, 29 Mar 2013 15:17:49 +0000 (-0700) Subject: rbd: send progress info to stderr, not stdout X-Git-Tag: v0.62~118^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88706ab89c2caf34405f4e0d0d97e9e1624c75ce;p=ceph.git rbd: send progress info to stderr, not stdout This avoids interfering when export is sent to stdout. Signed-off-by: Sage Weil --- diff --git a/src/rbd.cc b/src/rbd.cc index 988af0696305..d557a1e06d38 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -200,19 +200,19 @@ struct MyProgressContext : public librbd::ProgressContext { int update_progress(uint64_t offset, uint64_t total) { int pc = total ? (offset * 100ull / total) : 0; if (pc != last_pc) { - cout << "\r" << operation << ": " + cerr << "\r" << operation << ": " // << offset << " / " << total << " " << pc << "% complete..."; - cout.flush(); + cerr.flush(); last_pc = pc; } return 0; } void finish() { - cout << "\r" << operation << ": 100% complete...done." << std::endl; + cerr << "\r" << operation << ": 100% complete...done." << std::endl; } void fail() { - cout << "\r" << operation << ": " << last_pc << "% complete...failed." + cerr << "\r" << operation << ": " << last_pc << "% complete...failed." << std::endl; } };