]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: send progress info to stderr, not stdout
authorSage Weil <sage@inktank.com>
Fri, 29 Mar 2013 15:17:49 +0000 (08:17 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Mon, 1 Apr 2013 06:32:41 +0000 (23:32 -0700)
This avoids interfering when export is sent to stdout.

Signed-off-by: Sage Weil <sage@inktank.com>
src/rbd.cc

index 988af06963055e244cee1adb38420408ed69433e..d557a1e06d38be9ac1ab3a5c333d24ef5fb6c943 100644 (file)
@@ -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;
   }
 };