]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: clean up in ceph_mon.cc 14102/head
authorhuanwen ren <ren.huanwen@zte.com.cn>
Tue, 27 Jun 2017 10:52:08 +0000 (18:52 +0800)
committerhuanwen ren <ren.huanwen@zte.com.cn>
Tue, 27 Jun 2017 10:52:08 +0000 (18:52 +0800)
The output prints to the ceph-mon.log,
so need replace cout with dout,in addition, keep cout in the usage().

Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
src/ceph_mon.cc

index 0b5d4edfd7934f2f551818d22dea5a909120ecd3..258c0a732a0eef310fe8da27e8e7ae479e84b058 100644 (file)
@@ -368,8 +368,8 @@ int main(int argc, const char **argv)
          string name;
          monmap.get_addr_name(a, name);
          monmap.rename(name, g_conf->name.get_id());
-         cout << argv[0] << ": renaming mon." << name << " " << a
-              << " to mon." << g_conf->name.get_id() << std::endl;
+         dout(0) << argv[0] << ": renaming mon." << name << " " << a
+              << " to mon." << g_conf->name.get_id() << dendl;
        }
       } else {
        // is a local address listed without a name?  if so, name myself.
@@ -382,12 +382,12 @@ int main(int argc, const char **argv)
          monmap.get_addr_name(local, name);
 
          if (name.compare(0, 7, "noname-") == 0) {
-           cout << argv[0] << ": mon." << name << " " << local
-                << " is local, renaming to mon." << g_conf->name.get_id() << std::endl;
+           dout(0) << argv[0] << ": mon." << name << " " << local
+                << " is local, renaming to mon." << g_conf->name.get_id() << dendl;
            monmap.rename(name, g_conf->name.get_id());
          } else {
-           cout << argv[0] << ": mon." << name << " " << local
-                << " is local, but not 'noname-' + something; not assuming it's me" << std::endl;
+           dout(0) << argv[0] << ": mon." << name << " " << local
+                << " is local, but not 'noname-' + something; not assuming it's me" << dendl;
          }
        }
       }
@@ -395,7 +395,7 @@ int main(int argc, const char **argv)
 
     if (!g_conf->fsid.is_zero()) {
       monmap.fsid = g_conf->fsid;
-      cout << argv[0] << ": set fsid to " << g_conf->fsid << std::endl;
+      dout(0) << argv[0] << ": set fsid to " << g_conf->fsid << dendl;
     }
     
     if (monmap.fsid.is_zero()) {
@@ -435,8 +435,8 @@ int main(int argc, const char **argv)
       exit(1);
     }
     store.close();
-    cout << argv[0] << ": created monfs at " << g_conf->mon_data 
-        << " for " << g_conf->name << std::endl;
+    dout(0) << argv[0] << ": created monfs at " << g_conf->mon_data 
+        << " for " << g_conf->name << dendl;
     return 0;
   }
 
@@ -726,11 +726,11 @@ int main(int argc, const char **argv)
     prefork.exit(1);
   }
 
-  cout << "starting " << g_conf->name << " rank " << rank
+  dout(0) << "starting " << g_conf->name << " rank " << rank
        << " at " << ipaddr
        << " mon_data " << g_conf->mon_data
        << " fsid " << monmap.get_fsid()
-       << std::endl;
+       << dendl;
 
   // start monitor
   mon = new Monitor(g_ceph_context, g_conf->name.get_id(), store,