]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: normalize debug log message prefix
authorJason Dillaman <dillaman@redhat.com>
Thu, 26 May 2016 17:29:49 +0000 (13:29 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 31 May 2016 15:55:32 +0000 (11:55 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit d52843190d84d533ab50a1702cf4a829b71ad68b)

src/tools/rbd_mirror/ClusterWatcher.cc
src/tools/rbd_mirror/ImageDeleter.cc
src/tools/rbd_mirror/ImageReplayer.cc
src/tools/rbd_mirror/ImageReplayer.h
src/tools/rbd_mirror/Mirror.cc
src/tools/rbd_mirror/PoolWatcher.cc
src/tools/rbd_mirror/Replayer.cc

index 04525394667e9730a52f7769592d52dc7b33fc6a..7c4b6ddfc43889f06a7832bc4716f80af7714482 100644 (file)
@@ -10,7 +10,8 @@
 
 #define dout_subsys ceph_subsys_rbd_mirror
 #undef dout_prefix
-#define dout_prefix *_dout << "rbd-mirror: ClusterWatcher::" << __func__ << ": "
+#define dout_prefix *_dout << "rbd::mirror::ClusterWatcher:" << this << " " \
+                           << __func__ << ": "
 
 using std::list;
 using std::map;
index 6590ae55650fa32aa7f1237f0d304a70848f26f2..8e65223659e0657c61498d34cdf5c6783c9654f8 100644 (file)
@@ -33,7 +33,8 @@
 
 #define dout_subsys ceph_subsys_rbd_mirror
 #undef dout_prefix
-#define dout_prefix *_dout << "rbd-mirror: ImageDeleter::" << __func__ << ": "
+#define dout_prefix *_dout << "rbd::mirror::ImageDeleter: " << this << " " \
+                           << __func__ << ": "
 
 using std::string;
 using std::map;
index 4e88fb2b74461bf788e3781c1d752381c0715acc..5db2f43c660e10b27298d877b43bcc69e3e3fa10 100644 (file)
@@ -26,7 +26,8 @@
 
 #define dout_subsys ceph_subsys_rbd_mirror
 #undef dout_prefix
-#define dout_prefix *_dout << "rbd-mirror: " << *this << "::" << __func__ << ": "
+#define dout_prefix *_dout << "rbd::mirror::" << *this << " " \
+                           << __func__ << ": "
 
 using std::map;
 using std::string;
@@ -1251,8 +1252,8 @@ std::string ImageReplayer<I>::to_string(const State state) {
 template <typename I>
 std::ostream &operator<<(std::ostream &os, const ImageReplayer<I> &replayer)
 {
-  os << "ImageReplayer[" << replayer.get_remote_pool_id() << "/"
-     << replayer.get_remote_image_id() << "]";
+  os << "ImageReplayer: " << &replayer << " [" << replayer.get_local_pool_id()
+     << "/" << replayer.get_global_image_id() << "]";
   return os;
 }
 
index 82c9c19b7777f9ec814dcdc6c629337708350c43..b6bf4a25c443a749746bf9a1a2a6c1bc3bb616c6 100644 (file)
@@ -88,10 +88,27 @@ public:
 
   std::string get_name() { Mutex::Locker l(m_lock); return m_name; };
   void set_state_description(int r, const std::string &desc);
-  inline uint64_t get_local_pool_id() { return m_local_pool_id; }
-  inline const std::string get_local_image_id() { return m_local_image_id; }
-  inline const std::string get_global_image_id() { return m_global_image_id; }
-  inline const std::string get_local_image_name() { return m_local_image_name; }
+
+  inline int64_t get_local_pool_id() const {
+    return m_local_pool_id;
+  }
+  inline int64_t get_remote_pool_id() const {
+    return m_remote_pool_id;
+  }
+  inline const std::string& get_global_image_id() const {
+    return m_global_image_id;
+  }
+  inline const std::string& get_remote_image_id() const {
+    return m_remote_image_id;
+  }
+  inline std::string get_local_image_id() {
+    Mutex::Locker locker(m_lock);
+    return m_local_image_id;
+  }
+  inline std::string get_local_image_name() {
+    Mutex::Locker locker(m_lock);
+    return m_local_image_name;
+  }
 
   void start(Context *on_finish = nullptr,
             const BootstrapParams *bootstrap_params = nullptr,
@@ -105,15 +122,6 @@ public:
   virtual void handle_replay_ready();
   virtual void handle_replay_complete(int r, const std::string &error_desc);
 
-  inline const std::string get_global_image_id() const {
-    return m_global_image_id;
-  }
-  inline int64_t get_remote_pool_id() const {
-    return m_remote_pool_id;
-  }
-  inline const std::string get_remote_image_id() const {
-    return m_remote_image_id;
-  }
 protected:
   /**
    * @verbatim
index 3177bb7c3cd55f90bbdd8d28c5384b134fe109ad..73e980119d0ebc1354d81870cfb129b48caa16eb 100644 (file)
@@ -12,7 +12,8 @@
 
 #define dout_subsys ceph_subsys_rbd_mirror
 #undef dout_prefix
-#define dout_prefix *_dout << "rbd-mirror: Mirror::" << __func__ << ": "
+#define dout_prefix *_dout << "rbd::mirror::Mirror: " << this << " " \
+                           << __func__ << ": "
 
 using std::chrono::seconds;
 using std::list;
index a525b004401c8f84970893325809b3278fbdfa9f..21ccc2df7aa9222beee6704f231f740ff1d00510 100644 (file)
@@ -14,7 +14,8 @@
 
 #define dout_subsys ceph_subsys_rbd_mirror
 #undef dout_prefix
-#define dout_prefix *_dout << "rbd-mirror: PoolWatcher::" << __func__ << ": "
+#define dout_prefix *_dout << "rbd::mirror::PoolWatcher: " << this << " " \
+                           << __func__ << ": "
 
 using std::list;
 using std::string;
index ffa3e0644e9e910074f73e300677fe90cee99bf7..8dd3a0dfa7f6496bf5cfa1f2a435ca70f16e64cb 100644 (file)
@@ -19,7 +19,8 @@
 
 #define dout_subsys ceph_subsys_rbd_mirror
 #undef dout_prefix
-#define dout_prefix *_dout << "rbd-mirror: Replayer::" << __func__ << ": "
+#define dout_prefix *_dout << "rbd::mirror::Replayer: " \
+                           << this << " " << __func__ << ": "
 
 using std::chrono::seconds;
 using std::map;