]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: improve bucket index listing cls logging
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 25 Aug 2021 13:52:31 +0000 (09:52 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Tue, 31 Aug 2021 15:02:32 +0000 (11:02 -0400)
Adding more level 20 logging for bucket index listing.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/cls/rgw/cls_rgw.cc

index 5bd9813f6c4b15a4945d0c8b566ebdc300f8365d..222803e34142389eca7a06f11630c06a50880931 100644 (file)
@@ -363,7 +363,7 @@ static int encode_list_index_key(cls_method_context_t hctx, const cls_rgw_obj_ke
     return 0;
   }
   if (ret < 0) {
-    CLS_LOG(1, "ERROR: encode_list_index_key(): cls_cxx_map_get_val returned %d\n", ret);
+    CLS_LOG(1, "ERROR: encode_list_index_key(): cls_cxx_map_get_val returned %d", ret);
     return ret;
   }
 
@@ -384,7 +384,7 @@ static void split_key(const string& key, list<string>& vals)
   }
 }
 
-static string escape_str(const string& s)
+static std::string escape_str(const std::string& s)
 {
   int len = escape_json_attr_len(s.c_str(), s.size());
   std::string escaped(len, 0);
@@ -413,7 +413,7 @@ static int decode_list_index_key(const string& index_key, cls_rgw_obj_key *key,
   split_key(index_key, vals);
 
   if (vals.empty()) {
-    CLS_LOG(0, "ERROR: %s(): bad index_key (%s): split_key() returned empty vals", __func__, escape_str(index_key).c_str());
+    CLS_LOG(0, "ERROR: %s: bad index_key (%s): split_key() returned empty vals", __func__, escape_str(index_key).c_str());
     return -EIO;
   }
 
@@ -422,7 +422,7 @@ static int decode_list_index_key(const string& index_key, cls_rgw_obj_key *key,
   ++iter;
 
   if (iter == vals.end()) {
-    CLS_LOG(0, "ERROR: %s(): bad index_key (%s): no vals", __func__, escape_str(index_key).c_str());
+    CLS_LOG(0, "ERROR: %s: bad index_key (%s): no vals", __func__, escape_str(index_key).c_str());
     return -EIO;
   }
 
@@ -435,7 +435,7 @@ static int decode_list_index_key(const string& index_key, cls_rgw_obj_key *key,
       const char *s = val.c_str() + 1;
       *ver = strict_strtoll(s, 10, &err);
       if (!err.empty()) {
-        CLS_LOG(0, "ERROR: %s(): bad index_key (%s): could not parse val (v=%s)", __func__, escape_str(index_key).c_str(), s);
+        CLS_LOG(0, "ERROR: %s: bad index_key (%s): could not parse val (v=%s)", __func__, escape_str(index_key).c_str(), s);
         return -EIO;
       }
     }
@@ -469,7 +469,7 @@ static int read_bucket_header(cls_method_context_t hctx,
 
 int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
 
   // maximum number of calls to get_obj_vals we'll try; compromise
   // between wanting to return the requested # of entries, but not
@@ -482,7 +482,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   try {
     decode(op, iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(1, "ERROR: %s: failed to decode request\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to decode request", __func__);
     return -EINVAL;
   }
 
@@ -492,7 +492,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 
   int rc = read_bucket_header(hctx, &new_dir.header);
   if (rc < 0) {
-    CLS_LOG(1, "ERROR: %s: failed to read header\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to read header", __func__);
     return rc;
   }
 
@@ -551,7 +551,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
     if (rc < 0) {
       return rc;
     }
-    CLS_LOG(20, "%s: on attempt %d get_obj_vls returned %ld entries, more=%d\n",
+    CLS_LOG(20, "%s: on attempt %d get_obj_vls returned %ld entries, more=%d",
            __func__, attempt, keys.size(), more);
 
     done = keys.empty();
@@ -563,7 +563,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
        auto eiter = entrybl.cbegin();
         decode(entry, eiter);
       } catch (ceph::buffer::error& err) {
-        CLS_LOG(1, "ERROR: %s: failed to decode entry, key=%s\n",
+        CLS_LOG(1, "ERROR: %s: failed to decode entry, key=%s",
                __func__, kiter->first.c_str());
         return -EINVAL;
       }
@@ -577,13 +577,13 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       uint64_t ver;
       int ret = decode_list_index_key(kiter->first, &key, &ver);
       if (ret < 0) {
-        CLS_LOG(0, "ERROR: %s: failed to decode list index key (%s)\n",
+        CLS_LOG(0, "ERROR: %s: failed to decode list index key (%s)",
                __func__, escape_str(kiter->first).c_str());
         continue;
       }
 
       if (!entry.is_valid()) {
-        CLS_LOG(20, "%s: entry %s[%s] is not valid\n",
+        CLS_LOG(20, "%s: entry %s[%s] is not valid",
                __func__, key.name.c_str(), key.instance.c_str());
         continue;
       }
@@ -591,7 +591,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
       // filter out noncurrent versions, delete markers, and initial marker
       if (!op.list_versions &&
          (!entry.is_visible() || op.start_obj.name == key.name)) {
-        CLS_LOG(20, "%s: entry %s[%s] is not visible\n",
+        CLS_LOG(20, "%s: entry %s[%s] is not visible",
                __func__, key.name.c_str(), key.instance.c_str());
         continue;
       }
@@ -617,7 +617,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
            proxy_entry.flags = rgw_bucket_dir_entry::FLAG_COMMON_PREFIX;
            name_entry_map[prefix_key] = proxy_entry;
 
-           CLS_LOG(20, "%s: got common prefix entry %s[%s] num entries=%lu\n",
+           CLS_LOG(20, "%s: got common prefix entry %s[%s] num entries=%lu",
                    __func__, proxy_key.name.c_str(), proxy_key.instance.c_str(),
                    name_entry_map.size());
          }
@@ -644,7 +644,7 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
          kiter->first != prev_omap_key) {
         name_entry_map[kiter->first] = entry;
        prev_omap_key = kiter->first;
-       CLS_LOG(20, "%s: got object entry %s[%s] num entries=%d\n",
+       CLS_LOG(20, "%s: got object entry %s[%s] num entries=%d",
                __func__, key.name.c_str(), key.instance.c_str(),
                int(name_entry_map.size()));
       }
@@ -655,12 +655,12 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
   if (ret.is_truncated) {
     ret.marker = start_after_entry_key;
   }
-  CLS_LOG(20, "%s: normal exit returning %ld entries, is_truncated=%d\n",
+  CLS_LOG(20, "%s: normal exit returning %ld entries, is_truncated=%d",
          __func__, ret.dir.m.size(), ret.is_truncated);
   encode(ret, *out);
 
   if (ret.is_truncated && name_entry_map.size() == 0) {
-    CLS_LOG(5, "%s: returning value RGWBIAdvanceAndRetryError\n", __func__);
+    CLS_LOG(5, "%s: returning value RGWBIAdvanceAndRetryError", __func__);
     return RGWBIAdvanceAndRetryError;
   } else {
     return 0;
@@ -706,7 +706,7 @@ static int check_index(cls_method_context_t hctx,
       try {
         decode(entry, eiter);
       } catch (ceph::buffer::error& err) {
-        CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode entry, key=%s\n", kiter->first.c_str());
+        CLS_LOG(1, "ERROR: rgw_bucket_list(): failed to decode entry, key=%s", kiter->first.c_str());
         return -EIO;
       }
       rgw_bucket_category_stats& stats = calc_header->stats[entry.meta.category];
@@ -724,7 +724,7 @@ static int check_index(cls_method_context_t hctx,
 
 int rgw_bucket_check_index(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   rgw_cls_check_index_ret ret;
 
   int rc = check_index(hctx, &ret.existing_header, &ret.calculated_header);
@@ -748,7 +748,7 @@ static int write_bucket_header(cls_method_context_t hctx, rgw_bucket_dir_header
 
 int rgw_bucket_rebuild_index(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   rgw_bucket_dir_header existing_header;
   rgw_bucket_dir_header calc_header;
   int rc = check_index(hctx, &existing_header, &calc_header);
@@ -760,21 +760,21 @@ int rgw_bucket_rebuild_index(cls_method_context_t hctx, bufferlist *in, bufferli
 
 int rgw_bucket_update_stats(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_bucket_update_stats_op op;
   auto iter = in->cbegin();
   try {
     decode(op, iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(1, "ERROR: %s(): failed to decode request\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to decode request", __func__);
     return -EINVAL;
   }
 
   rgw_bucket_dir_header header;
   int rc = read_bucket_header(hctx, &header);
   if (rc < 0) {
-    CLS_LOG(1, "ERROR: %s(): failed to read header\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to read header", __func__);
     return rc;
   }
 
@@ -795,7 +795,7 @@ int rgw_bucket_update_stats(cls_method_context_t hctx, bufferlist *in, bufferlis
 
 int rgw_bucket_init_index(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   bufferlist header_bl;
   int rc = cls_cxx_map_read_header(hctx, &header_bl);
   if (rc < 0) {
@@ -820,7 +820,7 @@ int rgw_bucket_init_index(cls_method_context_t hctx, bufferlist *in, bufferlist
 
 int rgw_bucket_set_tag_timeout(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_tag_timeout_op op;
   auto iter = in->cbegin();
@@ -849,7 +849,7 @@ static int read_key_entry(cls_method_context_t hctx, cls_rgw_obj_key& key,
 
 int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_obj_prepare_op op;
   auto iter = in->cbegin();
@@ -865,7 +865,7 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist
     return -EINVAL;
   }
 
-  CLS_LOG(1, "rgw_bucket_prepare_op(): request: op=%d name=%s instance=%s tag=%s\n",
+  CLS_LOG(1, "rgw_bucket_prepare_op(): request: op=%d name=%s instance=%s tag=%s",
           op.op, op.key.name.c_str(), op.key.instance.c_str(), op.tag.c_str());
 
   // get on-disk state
@@ -912,14 +912,14 @@ static void unaccount_entry(rgw_bucket_dir_header& header,
 
 static void log_entry(const char *func, const char *str, rgw_bucket_dir_entry *entry)
 {
-  CLS_LOG(1, "%s(): %s: ver=%ld:%llu name=%s instance=%s locator=%s\n", func, str,
+  CLS_LOG(1, "%s: %s: ver=%ld:%llu name=%s instance=%s locator=%s", func, str,
           (long)entry->ver.pool, (unsigned long long)entry->ver.epoch,
           entry->key.name.c_str(), entry->key.instance.c_str(), entry->locator.c_str());
 }
 
 static void log_entry(const char *func, const char *str, rgw_bucket_olh_entry *entry)
 {
-  CLS_LOG(1, "%s(): %s: epoch=%llu name=%s instance=%s tag=%s\n", func, str,
+  CLS_LOG(1, "%s: %s: epoch=%llu name=%s instance=%s tag=%s", func, str,
           (unsigned long long)entry->epoch, entry->key.name.c_str(), entry->key.instance.c_str(),
           entry->tag.c_str());
 }
@@ -938,7 +938,7 @@ static int read_omap_entry(cls_method_context_t hctx, const std::string& name,
   try {
     decode(*entry, cur_iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(1, "ERROR: %s(): failed to decode entry\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to decode entry", __func__);
     return -EIO;
   }
   return 0;
@@ -992,7 +992,7 @@ static int read_key_entry(cls_method_context_t hctx, cls_rgw_obj_key& key,
 
 int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_obj_complete_op op;
   auto iter = in->cbegin();
@@ -1002,7 +1002,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
     CLS_LOG(1, "ERROR: rgw_bucket_complete_op(): failed to decode request\n");
     return -EINVAL;
   }
-  CLS_LOG(1, "rgw_bucket_complete_op(): request: op=%d name=%s instance=%s ver=%lu:%llu tag=%s\n",
+  CLS_LOG(1, "rgw_bucket_complete_op(): request: op=%d name=%s instance=%s ver=%lu:%llu tag=%s",
           op.op, op.key.name.c_str(), op.key.instance.c_str(),
           (unsigned long)op.ver.pool, (unsigned long long)op.ver.epoch,
           op.tag.c_str());
@@ -1118,21 +1118,21 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
       return rc;
   }
 
-  CLS_LOG(20, "rgw_bucket_complete_op(): remove_objs.size()=%d\n", (int)op.remove_objs.size());
+  CLS_LOG(20, "rgw_bucket_complete_op(): remove_objs.size()=%d", (int)op.remove_objs.size());
   for (auto remove_iter = op.remove_objs.begin(); remove_iter != op.remove_objs.end(); ++remove_iter) {
     cls_rgw_obj_key& remove_key = *remove_iter;
-    CLS_LOG(1, "rgw_bucket_complete_op(): removing entries, read_index_entry name=%s instance=%s\n",
+    CLS_LOG(1, "rgw_bucket_complete_op(): removing entries, read_index_entry name=%s instance=%s",
             remove_key.name.c_str(), remove_key.instance.c_str());
     rgw_bucket_dir_entry remove_entry;
     string k;
     int ret = read_key_entry(hctx, remove_key, &k, &remove_entry);
     if (ret < 0) {
-      CLS_LOG(1, "rgw_bucket_complete_op(): removing entries, read_index_entry name=%s instance=%s ret=%d\n",
+      CLS_LOG(1, "rgw_bucket_complete_op(): removing entries, read_index_entry name=%s instance=%s ret=%d",
             remove_key.name.c_str(), remove_key.instance.c_str(), ret);
       continue;
     }
     CLS_LOG(0,
-           "rgw_bucket_complete_op(): entry.name=%s entry.instance=%s entry.meta.category=%d\n",
+           "rgw_bucket_complete_op(): entry.name=%s entry.instance=%s entry.meta.category=%d",
             remove_entry.key.name.c_str(),
            remove_entry.key.instance.c_str(),
            int(remove_entry.meta.category));
@@ -1148,7 +1148,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
 
     ret = cls_cxx_map_remove_key(hctx, k);
     if (ret < 0) {
-      CLS_LOG(1, "rgw_bucket_complete_op(): cls_cxx_map_remove_key, failed to remove entry, name=%s instance=%s read_index_entry ret=%d\n", remove_key.name.c_str(), remove_key.instance.c_str(), rc);
+      CLS_LOG(1, "rgw_bucket_complete_op(): cls_cxx_map_remove_key, failed to remove entry, name=%s instance=%s read_index_entry ret=%d", remove_key.name.c_str(), remove_key.instance.c_str(), rc);
       continue;
     }
   }
@@ -1325,7 +1325,7 @@ public:
 
   int write(uint64_t epoch, bool current) {
     if (instance_entry.versioned_epoch > 0) {
-      CLS_LOG(20, "%s(): instance_entry.versioned_epoch=%d epoch=%d", __func__, (int)instance_entry.versioned_epoch, (int)epoch);
+      CLS_LOG(20, "%s: instance_entry.versioned_epoch=%d epoch=%d", __func__, (int)instance_entry.versioned_epoch, (int)epoch);
       /* this instance has a previous list entry, remove that entry */
       int ret = unlink_list_entry();
       if (ret < 0) {
@@ -1567,7 +1567,7 @@ static int convert_plain_entry_to_versioned(cls_method_context_t hctx,
  */
 static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   string olh_data_idx;
   string instance_idx;
 
@@ -1619,7 +1619,7 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
     if (olh_found && olh.get_entry().delete_marker) {
       CLS_LOG(10,
              "%s: delete marker received for \"%s\" although OLH"
-             " already refers to a delete marker\n",
+             " already refers to a delete marker",
              __func__, escape_str(op.key.to_string()).c_str());
       return -ENOENT;
     }
@@ -1802,7 +1802,7 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
 
 static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   string olh_data_idx;
   string instance_idx;
 
@@ -1870,7 +1870,7 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in,
 
   rgw_bucket_olh_entry& olh_entry = olh.get_entry();
   cls_rgw_obj_key& olh_key = olh_entry.key;
-  CLS_LOG(20, "%s(): updating olh log: existing olh entry: %s[%s] (delete_marker=%d)", __func__,
+  CLS_LOG(20, "%s: updating olh log: existing olh entry: %s[%s] (delete_marker=%d)", __func__,
              olh_key.name.c_str(), olh_key.instance.c_str(), olh_entry.delete_marker);
 
   if (olh_key == dest_key) {
@@ -1891,7 +1891,7 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in,
         return ret;
       }
 
-      CLS_LOG(20, "%s(): updating olh log: link olh -> %s[%s] (is_delete=%d)", __func__,
+      CLS_LOG(20, "%s: updating olh log: link olh -> %s[%s] (is_delete=%d)", __func__,
               next_key.name.c_str(), next_key.instance.c_str(), (int)next.is_delete_marker());
 
       olh.update(next_key, next.is_delete_marker());
@@ -1959,7 +1959,7 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in,
 
 static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_read_olh_log_op op;
   auto iter = in->cbegin();
@@ -1985,7 +1985,7 @@ static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bu
   }
 
   if (olh_data_entry.tag != op.olh_tag) {
-    CLS_LOG(1, "NOTICE: %s(): olh_tag_mismatch olh_data_entry.tag=%s op.olh_tag=%s", __func__, olh_data_entry.tag.c_str(), op.olh_tag.c_str());
+    CLS_LOG(1, "NOTICE: %s: olh_tag_mismatch olh_data_entry.tag=%s op.olh_tag=%s", __func__, olh_data_entry.tag.c_str(), op.olh_tag.c_str());
     return -ECANCELED;
   }
 
@@ -2013,7 +2013,7 @@ static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bu
 
 static int rgw_bucket_trim_olh_log(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_trim_olh_log_op op;
   auto iter = in->cbegin();
@@ -2040,7 +2040,7 @@ static int rgw_bucket_trim_olh_log(cls_method_context_t hctx, bufferlist *in, bu
   }
 
   if (olh_data_entry.tag != op.olh_tag) {
-    CLS_LOG(1, "NOTICE: %s(): olh_tag_mismatch olh_data_entry.tag=%s op.olh_tag=%s", __func__, olh_data_entry.tag.c_str(), op.olh_tag.c_str());
+    CLS_LOG(1, "NOTICE: %s: olh_tag_mismatch olh_data_entry.tag=%s op.olh_tag=%s", __func__, olh_data_entry.tag.c_str(), op.olh_tag.c_str());
     return -ECANCELED;
   }
 
@@ -2065,7 +2065,7 @@ static int rgw_bucket_trim_olh_log(cls_method_context_t hctx, bufferlist *in, bu
 
 static int rgw_bucket_clear_olh(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_bucket_clear_olh_op op;
   auto iter = in->cbegin();
@@ -2092,13 +2092,13 @@ static int rgw_bucket_clear_olh(cls_method_context_t hctx, bufferlist *in, buffe
   }
 
   if (olh_data_entry.tag != op.olh_tag) {
-    CLS_LOG(1, "NOTICE: %s(): olh_tag_mismatch olh_data_entry.tag=%s op.olh_tag=%s", __func__, olh_data_entry.tag.c_str(), op.olh_tag.c_str());
+    CLS_LOG(1, "NOTICE: %s: olh_tag_mismatch olh_data_entry.tag=%s op.olh_tag=%s", __func__, olh_data_entry.tag.c_str(), op.olh_tag.c_str());
     return -ECANCELED;
   }
 
   ret = cls_cxx_map_remove_key(hctx, olh_data_key);
   if (ret < 0) {
-    CLS_LOG(1, "NOTICE: %s(): can't remove key %s ret=%d", __func__, olh_data_key.c_str(), ret);
+    CLS_LOG(1, "NOTICE: %s: can't remove key %s ret=%d", __func__, olh_data_key.c_str(), ret);
     return ret;
   }
 
@@ -2122,7 +2122,7 @@ static int rgw_bucket_clear_olh(cls_method_context_t hctx, bufferlist *in, buffe
 
   ret = cls_cxx_map_remove_key(hctx, op.key.name);
   if (ret < 0) {
-    CLS_LOG(1, "NOTICE: %s(): can't remove key %s ret=%d", __func__, op.key.name.c_str(), ret);
+    CLS_LOG(1, "NOTICE: %s: can't remove key %s ret=%d", __func__, op.key.name.c_str(), ret);
     return ret;
   }
 
@@ -2132,7 +2132,7 @@ static int rgw_bucket_clear_olh(cls_method_context_t hctx, bufferlist *in, buffe
 int rgw_dir_suggest_changes(cls_method_context_t hctx,
                            bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(1, "entered %s()\n", __func__);
+  CLS_LOG(1, "entered %s", __func__);
 
   bufferlist header_bl;
   rgw_bucket_dir_header header;
@@ -2192,14 +2192,14 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
       }
     }
 
-    CLS_LOG(20, "cur_disk.pending_map.empty()=%d op=%d cur_disk.exists=%d cur_change.pending_map.size()=%d cur_change.exists=%d\n",
+    CLS_LOG(20, "cur_disk.pending_map.empty()=%d op=%d cur_disk.exists=%d cur_change.pending_map.size()=%d cur_change.exists=%d",
            cur_disk.pending_map.empty(), (int)op, cur_disk.exists,
            (int)cur_change.pending_map.size(), cur_change.exists);
 
     if (cur_disk.pending_map.empty()) {
       if (cur_disk.exists) {
         rgw_bucket_category_stats& old_stats = header.stats[cur_disk.meta.category];
-        CLS_LOG(10, "total_entries: %" PRId64 " -> %" PRId64 "\n", old_stats.num_entries, old_stats.num_entries - 1);
+        CLS_LOG(10, "total_entries: %" PRId64 " -> %" PRId64 "", old_stats.num_entries, old_stats.num_entries - 1);
         old_stats.num_entries--;
         old_stats.total_size -= cur_disk.meta.accounted_size;
         old_stats.total_size_rounded -= cls_rgw_get_rounded_size(cur_disk.meta.accounted_size);
@@ -2211,7 +2211,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
       op &= CEPH_RGW_DIR_SUGGEST_OP_MASK;
       switch(op) {
       case CEPH_RGW_REMOVE:
-        CLS_LOG(10, "CEPH_RGW_REMOVE name=%s instance=%s\n", cur_change.key.name.c_str(), cur_change.key.instance.c_str());
+        CLS_LOG(10, "CEPH_RGW_REMOVE name=%s instance=%s", cur_change.key.name.c_str(), cur_change.key.instance.c_str());
        ret = cls_cxx_map_remove_key(hctx, cur_change_key);
        if (ret < 0)
          return ret;
@@ -2219,13 +2219,13 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
           ret = log_index_operation(hctx, cur_disk.key, CLS_RGW_OP_DEL, cur_disk.tag, cur_disk.meta.mtime,
                                     cur_disk.ver, CLS_RGW_STATE_COMPLETE, header.ver, header.max_marker, 0, NULL, NULL, NULL);
           if (ret < 0) {
-            CLS_LOG(0, "ERROR: %s(): failed to log operation ret=%d", __func__, ret);
+            CLS_LOG(0, "ERROR: %s: failed to log operation ret=%d", __func__, ret);
             return ret;
           }
         }
         break;
       case CEPH_RGW_UPDATE:
-        CLS_LOG(10, "CEPH_RGW_UPDATE name=%s instance=%s total_entries: %" PRId64 " -> %" PRId64 "\n",
+        CLS_LOG(10, "CEPH_RGW_UPDATE name=%s instance=%s total_entries: %" PRId64 " -> %" PRId64 "",
                 cur_change.key.name.c_str(), cur_change.key.instance.c_str(), stats.num_entries, stats.num_entries + 1);
 
         stats.num_entries++;
@@ -2243,7 +2243,7 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
           ret = log_index_operation(hctx, cur_change.key, CLS_RGW_OP_ADD, cur_change.tag, cur_change.meta.mtime,
                                     cur_change.ver, CLS_RGW_STATE_COMPLETE, header.ver, header.max_marker, 0, NULL, NULL, NULL);
           if (ret < 0) {
-            CLS_LOG(0, "ERROR: %s(): failed to log operation ret=%d", __func__, ret);
+            CLS_LOG(0, "ERROR: %s: failed to log operation ret=%d", __func__, ret);
             return ret;
           }
         }
@@ -2260,14 +2260,14 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx,
 
 static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_obj_remove_op op;
   auto iter = in->cbegin();
   try {
     decode(op, iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
+    CLS_LOG(0, "ERROR: %s: failed to decode request", __func__);
     return -EINVAL;
   }
 
@@ -2278,7 +2278,7 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
   map<string, bufferlist> attrset;
   int ret = cls_cxx_getxattrs(hctx, &attrset);
   if (ret < 0 && ret != -ENOENT) {
-    CLS_LOG(0, "ERROR: %s(): cls_cxx_getxattrs() returned %d", __func__, ret);
+    CLS_LOG(0, "ERROR: %s: cls_cxx_getxattrs() returned %d", __func__, ret);
     return ret;
   }
 
@@ -2299,10 +2299,10 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
     }
   }
 
-  CLS_LOG(20, "%s(): removing object", __func__);
+  CLS_LOG(20, "%s: removing object", __func__);
   ret = cls_cxx_remove(hctx);
   if (ret < 0) {
-    CLS_LOG(0, "ERROR: %s(): cls_cxx_remove returned %d", __func__, ret);
+    CLS_LOG(0, "ERROR: %s: cls_cxx_remove returned %d", __func__, ret);
     return ret;
   }
 
@@ -2313,7 +2313,7 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
 
   ret = cls_cxx_create(hctx, false);
   if (ret < 0) {
-    CLS_LOG(0, "ERROR: %s(): cls_cxx_create returned %d", __func__, ret);
+    CLS_LOG(0, "ERROR: %s: cls_cxx_create returned %d", __func__, ret);
     return ret;
   }
 
@@ -2322,9 +2322,9 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
     const auto& attr = aiter->first;
 
     ret = cls_cxx_setxattr(hctx, attr.c_str(), &aiter->second);
-    CLS_LOG(20, "%s(): setting attr: %s", __func__, attr.c_str());
+    CLS_LOG(20, "%s: setting attr: %s", __func__, attr.c_str());
     if (ret < 0) {
-      CLS_LOG(0, "ERROR: %s(): cls_cxx_setxattr (attr=%s) returned %d", __func__, attr.c_str(), ret);
+      CLS_LOG(0, "ERROR: %s: cls_cxx_setxattr (attr=%s) returned %d", __func__, attr.c_str(), ret);
       return ret;
     }
   }
@@ -2334,14 +2334,14 @@ static int rgw_obj_remove(cls_method_context_t hctx, bufferlist *in, bufferlist
 
 static int rgw_obj_store_pg_ver(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_obj_store_pg_ver_op op;
   auto iter = in->cbegin();
   try {
     decode(op, iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
+    CLS_LOG(0, "ERROR: %s: failed to decode request", __func__);
     return -EINVAL;
   }
 
@@ -2350,7 +2350,7 @@ static int rgw_obj_store_pg_ver(cls_method_context_t hctx, bufferlist *in, buffe
   encode(ver, bl);
   int ret = cls_cxx_setxattr(hctx, op.attr.c_str(), &bl);
   if (ret < 0) {
-    CLS_LOG(0, "ERROR: %s(): cls_cxx_setxattr (attr=%s) returned %d", __func__, op.attr.c_str(), ret);
+    CLS_LOG(0, "ERROR: %s: cls_cxx_setxattr (attr=%s) returned %d", __func__, op.attr.c_str(), ret);
     return ret;
   }
 
@@ -2359,14 +2359,14 @@ static int rgw_obj_store_pg_ver(cls_method_context_t hctx, bufferlist *in, buffe
 
 static int rgw_obj_check_attrs_prefix(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_obj_check_attrs_prefix op;
   auto iter = in->cbegin();
   try {
     decode(op, iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
+    CLS_LOG(0, "ERROR: %s: failed to decode request", __func__);
     return -EINVAL;
   }
 
@@ -2377,7 +2377,7 @@ static int rgw_obj_check_attrs_prefix(cls_method_context_t hctx, bufferlist *in,
   map<string, bufferlist> attrset;
   int ret = cls_cxx_getxattrs(hctx, &attrset);
   if (ret < 0 && ret != -ENOENT) {
-    CLS_LOG(0, "ERROR: %s(): cls_cxx_getxattrs() returned %d", __func__, ret);
+    CLS_LOG(0, "ERROR: %s: cls_cxx_getxattrs() returned %d", __func__, ret);
     return ret;
   }
 
@@ -2403,21 +2403,21 @@ static int rgw_obj_check_attrs_prefix(cls_method_context_t hctx, bufferlist *in,
 
 static int rgw_obj_check_mtime(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_obj_check_mtime op;
   auto iter = in->cbegin();
   try {
     decode(op, iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
+    CLS_LOG(0, "ERROR: %s: failed to decode request", __func__);
     return -EINVAL;
   }
 
   real_time obj_ut;
   int ret = cls_cxx_stat2(hctx, NULL, &obj_ut);
   if (ret < 0 && ret != -ENOENT) {
-    CLS_LOG(0, "ERROR: %s(): cls_cxx_stat() returned %d", __func__, ret);
+    CLS_LOG(0, "ERROR: %s: cls_cxx_stat() returned %d", __func__, ret);
     return ret;
   }
   if (ret == -ENOENT) {
@@ -2467,14 +2467,14 @@ static int rgw_obj_check_mtime(cls_method_context_t hctx, bufferlist *in, buffer
 
 static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_bi_get_op op;
   auto iter = in->cbegin();
   try {
     decode(op, iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
+    CLS_LOG(0, "ERROR: %s: failed to decode request", __func__);
     return -EINVAL;
   }
 
@@ -2491,7 +2491,7 @@ static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
       encode_olh_data_key(op.key, &idx);
       break;
     default:
-      CLS_LOG(10, "%s(): invalid key type encoding: %d",
+      CLS_LOG(10, "%s: invalid key type encoding: %d",
              __func__, int(op.type));
       return -EINVAL;
   }
@@ -2505,7 +2505,7 @@ static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
 
   int r = cls_cxx_map_get_val(hctx, idx, &entry.data);
   if (r < 0) {
-      CLS_LOG(10, "%s(): cls_cxx_map_get_val() returned %d", __func__, r);
+      CLS_LOG(10, "%s: cls_cxx_map_get_val() returned %d", __func__, r);
       return r;
   }
 
@@ -2516,14 +2516,14 @@ static int rgw_bi_get_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
 
 static int rgw_bi_put_op(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_bi_put_op op;
   auto iter = in->cbegin();
   try {
     decode(op, iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
+    CLS_LOG(0, "ERROR: %s: failed to decode request", __func__);
     return -EINVAL;
   }
 
@@ -2531,7 +2531,7 @@ static int rgw_bi_put_op(cls_method_context_t hctx, bufferlist *in, bufferlist *
 
   int r = cls_cxx_map_set_val(hctx, entry.idx, &entry.data);
   if (r < 0) {
-    CLS_LOG(0, "ERROR: %s(): cls_cxx_map_set_val() returned r=%d", __func__, r);
+    CLS_LOG(0, "ERROR: %s: cls_cxx_map_set_val() returned r=%d", __func__, r);
   }
 
   return 0;
@@ -2565,10 +2565,15 @@ static int list_plain_entries_help(cls_method_context_t hctx,
                                   bool& end_key_reached,
                                   bool& more)
 {
+  CLS_LOG(10, "Entered %s: name_filter=\"%s\", start_after_key=\"%s\", end_key=\"%s\", max=%d",
+         __func__, escape_str(name_filter).c_str(), escape_str(start_after_key).c_str(),
+         escape_str(end_key).c_str(), max);
   int count = 0;
   std::map<std::string, bufferlist> raw_entries;
   int ret = cls_cxx_map_get_vals(hctx, start_after_key, name_filter, max,
                                 &raw_entries, &more);
+  CLS_LOG(20, "%s: cls_cxx_map_get_vals ret=%d, raw_entries.size()=%lu, more=%d",
+         __func__, ret, raw_entries.size(), more);
   if (ret < 0) {
     return ret;
   }
@@ -2576,6 +2581,8 @@ static int list_plain_entries_help(cls_method_context_t hctx,
   end_key_reached = false;
   for (auto iter : raw_entries) {
     if (!end_key.empty() && iter.first >= end_key) {
+      CLS_LOG(20, "%s: end key reached at \"%s\"",
+             __func__, escape_str(iter.first).c_str());
       end_key_reached = true;
       more = false;
       return count;
@@ -2643,6 +2650,8 @@ static int list_plain_entries(cls_method_context_t hctx,
                               bool* pmore,
                              const PlainEntriesRegion region = PlainEntriesRegion::Both)
 {
+  CLS_LOG(10, "entered %s: name_filter=\"%s\", marker=\"%s\", max=%d, region=%d",
+         __func__, escape_str(name_filter).c_str(), escape_str(marker).c_str(), max, static_cast<int>(region));
   int r = 0;
   bool end_key_reached = false;
   bool more = false;
@@ -2652,6 +2661,8 @@ static int list_plain_entries(cls_method_context_t hctx,
     // listing ascii plain namespace
     int r = list_plain_entries_help(hctx, name_filter, marker, BI_PREFIX_BEGIN, max,
                                    entries, end_key_reached, more);
+    CLS_LOG(20, "%s: first list_plain_entries_help r=%d, end_key_reached=%d, more=%d",
+           __func__, r, end_key_reached, more);
     if (r < 0) {
       return r;
     }
@@ -2674,6 +2685,8 @@ static int list_plain_entries(cls_method_context_t hctx,
     // listing non-ascii plain namespace
     r = list_plain_entries_help(hctx, name_filter, start_after_key, {}, max,
                                entries, end_key_reached, more);
+    CLS_LOG(20, "%s: second list_plain_entries_help r=%d, end_key_reached=%d, more=%d",
+           __func__, r, end_key_reached, more);
     if (r < 0) {
       return r;
     }
@@ -2722,7 +2735,7 @@ static int list_instance_entries(cls_method_context_t hctx,
   if (max > 0) {
     ret = cls_cxx_map_get_vals(hctx, start_after_key, string(), max,
                               &keys, pmore);
-    CLS_LOG(20, "%s(): start_after_key=%s first_instance_idx=%s keys.size()=%d",
+    CLS_LOG(20, "%s: start_after_key=\"%s\" first_instance_idx=\"%s\" keys.size()=%d",
            __func__, escape_str(start_after_key).c_str(),
            escape_str(first_instance_idx).c_str(), (int)keys.size());
     if (ret < 0) {
@@ -2747,7 +2760,7 @@ static int list_instance_entries(cls_method_context_t hctx,
       return count;
     }
 
-    CLS_LOG(20, "%s(): entry.idx=%s", __func__, escape_str(entry.idx).c_str());
+    CLS_LOG(20, "%s: entry.idx=\"%s\"", __func__, escape_str(entry.idx).c_str());
 
     auto biter = entry.data.cbegin();
 
@@ -2755,7 +2768,7 @@ static int list_instance_entries(cls_method_context_t hctx,
     try {
       decode(e, biter);
     } catch (ceph::buffer::error& err) {
-      CLS_LOG(0, "ERROR: %s(): failed to decode buffer (size=%d)", __func__, entry.data.length());
+      CLS_LOG(0, "ERROR: %s: failed to decode buffer (size=%d)", __func__, entry.data.length());
       return -EIO;
     }
 
@@ -2812,7 +2825,7 @@ static int list_olh_entries(cls_method_context_t hctx,
   if (max > 0) {
     ret = cls_cxx_map_get_vals(hctx, start_after_key, string(), max,
                               &keys, pmore);
-    CLS_LOG(20, "%s(): start_after_key=%s first_instance_idx=%s keys.size()=%d",
+    CLS_LOG(20, "%s: start_after_key=\"%s\", first_instance_idx=\"%s\", keys.size()=%d",
            __func__, escape_str(start_after_key).c_str(),
            escape_str(first_instance_idx).c_str(), (int)keys.size());
     if (ret < 0) {
@@ -2838,7 +2851,7 @@ static int list_olh_entries(cls_method_context_t hctx,
       return count;
     }
 
-    CLS_LOG(20, "%s(): entry.idx=%s", __func__, escape_str(entry.idx).c_str());
+    CLS_LOG(20, "%s: entry.idx=\"%s\"", __func__, escape_str(entry.idx).c_str());
 
     auto biter = entry.data.cbegin();
 
@@ -2846,7 +2859,7 @@ static int list_olh_entries(cls_method_context_t hctx,
     try {
       decode(e, biter);
     } catch (ceph::buffer::error& err) {
-      CLS_LOG(0, "ERROR: %s(): failed to decode buffer (size=%d)", __func__, entry.data.length());
+      CLS_LOG(0, "ERROR: %s: failed to decode buffer (size=%d)", __func__, entry.data.length());
       return -EIO;
     }
 
@@ -2891,20 +2904,23 @@ static int rgw_bi_list_op(cls_method_context_t hctx,
                          bufferlist *in,
                          bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   // decode request
   rgw_cls_bi_list_op op;
   auto iter = in->cbegin();
   try {
     decode(op, iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(0, "ERROR: %s(): failed to decode request", __func__);
+    CLS_LOG(0, "ERROR: %s: failed to decode request", __func__);
     return -EINVAL;
   }
 
   constexpr uint32_t MAX_BI_LIST_ENTRIES = 1000;
   const uint32_t max = std::min(op.max, MAX_BI_LIST_ENTRIES);
 
+  CLS_LOG(20, "%s: op.marker=\"%s\", op.name_filter=\"%s\", op.max=%u max=%u",
+         __func__, escape_str(op.marker).c_str(), escape_str(op.name_filter).c_str(),
+         op.max, max);
 
   int ret;
   uint32_t count = 0;
@@ -2920,7 +2936,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx,
   }
 
   count = ret;
-  CLS_LOG(20, "found %d plain ascii (low) entries", count);
+  CLS_LOG(20, "%s: found %d plain ascii (low) entries, count=%u", __func__, ret, count);
 
   if (!more) {
     ret = list_instance_entries(hctx, op.name_filter, op.marker, max - count, &op_ret.entries, &more);
@@ -2930,6 +2946,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx,
     }
 
     count += ret;
+    CLS_LOG(20, "%s: found %d instance entries, count=%u", __func__, ret, count);
   }
 
   if (!more) {
@@ -2940,6 +2957,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx,
     }
 
     count += ret;
+    CLS_LOG(20, "%s: found %d olh entries, count=%u", __func__, ret, count);
   }
 
   if (!more) {
@@ -2952,7 +2970,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx,
     }
 
     count += ret;
-    CLS_LOG(20, "found %d non-ascii (high) plain entries", count);
+    CLS_LOG(20, "%s: found %d non-ascii (high) plain entries, count=%u", __func__, ret, count);
   }
 
   op_ret.is_truncated = (count > max) || more;
@@ -2961,6 +2979,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx,
     count--;
   }
 
+  CLS_LOG(20, "%s: returning %lu entries, is_truncated=%d", __func__, op_ret.entries.size(), op_ret.is_truncated);
   encode(op_ret, *out);
 
   return 0;
@@ -3019,7 +3038,7 @@ static int bi_log_iterate_entries(cls_method_context_t hctx,
     end_key.append(end_marker);
   }
 
-  CLS_LOG(10, "bi_log_iterate_entries start_after_key=%s end_key=%s\n",
+  CLS_LOG(10, "bi_log_iterate_entries start_after_key=%s end_key=%s",
          start_after_key.c_str(), end_key.c_str());
 
   string filter;
@@ -3039,7 +3058,7 @@ static int bi_log_iterate_entries(cls_method_context_t hctx,
     const string& key = iter->first;
     rgw_bi_log_entry e;
 
-    CLS_LOG(10, "bi_log_iterate_entries key=%s bl.length=%d\n", key.c_str(), (int)iter->second.length());
+    CLS_LOG(10, "bi_log_iterate_entries key=%s bl.length=%d", key.c_str(), (int)iter->second.length());
 
     if (key.compare(end_key) > 0) {
       key_iter = key;
@@ -3085,7 +3104,7 @@ static int bi_log_list_entries(cls_method_context_t hctx, const string& marker,
 
 static int rgw_bi_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_bi_log_list_op op;
@@ -3108,7 +3127,7 @@ static int rgw_bi_log_list(cls_method_context_t hctx, bufferlist *in, bufferlist
 
 static int rgw_bi_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_bi_log_trim_op op;
@@ -3170,7 +3189,7 @@ static int rgw_bi_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist
 
 static int rgw_bi_log_resync(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   rgw_bucket_dir_header header;
   int rc = read_bucket_header(hctx, &header);
   if (rc < 0) {
@@ -3205,7 +3224,7 @@ static int rgw_bi_log_resync(cls_method_context_t hctx, bufferlist *in, bufferli
 
 static int rgw_bi_log_stop(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   rgw_bucket_dir_header header;
   int rc = read_bucket_header(hctx, &header);
   if (rc < 0) {
@@ -3281,7 +3300,7 @@ static int usage_record_decode(bufferlist& record_bl, rgw_usage_log_entry& e)
 
 int rgw_user_usage_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
 
   auto in_iter = in->cbegin();
   rgw_cls_usage_log_add_op op;
@@ -3303,12 +3322,12 @@ int rgw_user_usage_log_add(cls_method_context_t hctx, bufferlist *in, bufferlist
 
     usage_record_name_by_time(entry.epoch, puser->to_str(), entry.bucket, key_by_time);
 
-    CLS_LOG(10, "rgw_user_usage_log_add user=%s bucket=%s\n", puser->to_str().c_str(), entry.bucket.c_str());
+    CLS_LOG(10, "rgw_user_usage_log_add user=%s bucket=%s", puser->to_str().c_str(), entry.bucket.c_str());
 
     bufferlist record_bl;
     int ret = cls_cxx_map_get_val(hctx, key_by_time, &record_bl);
     if (ret < 0 && ret != -ENOENT) {
-      CLS_LOG(1, "ERROR: rgw_user_usage_log_add(): cls_cxx_map_read_key returned %d\n", ret);
+      CLS_LOG(1, "ERROR: rgw_user_usage_log_add(): cls_cxx_map_read_key returned %d", ret);
       return -EINVAL;
     }
     if (ret >= 0) {
@@ -3341,7 +3360,7 @@ static int usage_iterate_range(cls_method_context_t hctx, uint64_t start, uint64
                             int (*cb)(cls_method_context_t, const string&, rgw_usage_log_entry&, void *),
                             void *param)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
 
   map<string, bufferlist> keys;
   string filter_prefix;
@@ -3440,7 +3459,7 @@ static int usage_log_read_cb(cls_method_context_t hctx, const string& key, rgw_u
 
 int rgw_user_usage_log_read(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
 
   auto in_iter = in->cbegin();
   rgw_cls_usage_log_read_op op;
@@ -3490,7 +3509,7 @@ static int usage_log_trim_cb(cls_method_context_t hctx, const string& key, rgw_u
 
 int rgw_user_usage_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
 
   /* only continue if object exists! */
   int ret = cls_cxx_stat(hctx, NULL, NULL);
@@ -3523,7 +3542,7 @@ int rgw_user_usage_log_trim(cls_method_context_t hctx, bufferlist *in, bufferlis
 
 int rgw_usage_log_clear(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
 
   int ret = cls_cxx_map_clear(hctx);
   /* if object doesn't exist all the logs are cleared anyway */
@@ -3622,7 +3641,7 @@ static int gc_update_entry(cls_method_context_t hctx, uint32_t expiration_secs,
     get_time_key(old_info.time, &key);
     ret = gc_omap_remove(hctx, GC_OBJ_TIME_INDEX, key);
     if (ret < 0 && ret != -ENOENT) {
-      CLS_LOG(0, "ERROR: failed to remove key=%s\n", key.c_str());
+      CLS_LOG(0, "ERROR: failed to remove key=%s", key.c_str());
       return ret;
     }
   }
@@ -3652,7 +3671,7 @@ static int gc_update_entry(cls_method_context_t hctx, uint32_t expiration_secs,
 
 done_err:
 
-  CLS_LOG(0, "ERROR: gc_set_entry error info.tag=%s, ret=%d\n",
+  CLS_LOG(0, "ERROR: gc_set_entry error info.tag=%s, ret=%d",
          info.tag.c_str(), ret);
   gc_omap_remove(hctx, GC_OBJ_NAME_INDEX, info.tag);
 
@@ -3682,7 +3701,7 @@ int gc_record_decode(bufferlist& bl, cls_rgw_gc_obj_info& e)
 
 static int rgw_cls_gc_set_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_gc_set_entry_op op;
@@ -3698,7 +3717,7 @@ static int rgw_cls_gc_set_entry(cls_method_context_t hctx, bufferlist *in, buffe
 
 static int rgw_cls_gc_defer_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_gc_defer_entry_op op;
@@ -3746,7 +3765,7 @@ static int gc_iterate_entries(cls_method_context_t hctx,
     get_time_key(now, &now_str);
     prepend_index_prefix(now_str, GC_OBJ_TIME_INDEX, &end_key);
 
-    CLS_LOG(10, "gc_iterate_entries end_key=%s\n", end_key.c_str());
+    CLS_LOG(10, "gc_iterate_entries end_key=%s", end_key.c_str());
   }
 
   string filter;
@@ -3768,7 +3787,7 @@ static int gc_iterate_entries(cls_method_context_t hctx,
     const string& key = iter->first;
     cls_rgw_gc_obj_info e;
 
-    CLS_LOG(10, "gc_iterate_entries key=%s\n", key.c_str());
+    CLS_LOG(10, "gc_iterate_entries key=%s", key.c_str());
 
     if (!end_key.empty() && key.compare(end_key) >= 0) {
       if (truncated)
@@ -3821,7 +3840,7 @@ static int gc_list_entries(cls_method_context_t hctx, const string& marker,
 
 static int rgw_cls_gc_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_gc_list_op op;
@@ -3851,7 +3870,7 @@ static int gc_remove(cls_method_context_t hctx, vector<string>& tags)
     cls_rgw_gc_obj_info info;
     int ret = gc_omap_get(hctx, GC_OBJ_NAME_INDEX, tag, &info);
     if (ret == -ENOENT) {
-      CLS_LOG(0, "couldn't find tag in name index tag=%s\n", tag.c_str());
+      CLS_LOG(0, "couldn't find tag in name index tag=%s", tag.c_str());
       continue;
     }
 
@@ -3864,7 +3883,7 @@ static int gc_remove(cls_method_context_t hctx, vector<string>& tags)
     if (ret < 0 && ret != -ENOENT)
       return ret;
     if (ret == -ENOENT) {
-      CLS_LOG(0, "couldn't find key in time index key=%s\n", time_key.c_str());
+      CLS_LOG(0, "couldn't find key in time index key=%s", time_key.c_str());
     }
 
     ret = gc_omap_remove(hctx, GC_OBJ_NAME_INDEX, tag);
@@ -3877,7 +3896,7 @@ static int gc_remove(cls_method_context_t hctx, vector<string>& tags)
 
 static int rgw_cls_gc_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_gc_remove_op op;
@@ -3893,7 +3912,7 @@ static int rgw_cls_gc_remove(cls_method_context_t hctx, bufferlist *in, bufferli
 
 static int rgw_cls_lc_get_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_lc_get_entry_op op;
@@ -3917,7 +3936,7 @@ static int rgw_cls_lc_get_entry(cls_method_context_t hctx, bufferlist *in, buffe
 
 static int rgw_cls_lc_set_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_lc_set_entry_op op;
@@ -3937,7 +3956,7 @@ static int rgw_cls_lc_set_entry(cls_method_context_t hctx, bufferlist *in, buffe
 
 static int rgw_cls_lc_rm_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_lc_rm_entry_op op;
@@ -3954,7 +3973,7 @@ static int rgw_cls_lc_rm_entry(cls_method_context_t hctx, bufferlist *in, buffer
 
 static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
   cls_rgw_lc_get_next_entry_ret op_ret;
   cls_rgw_lc_get_next_entry_op op;
@@ -3990,7 +4009,7 @@ static int rgw_cls_lc_get_next_entry(cls_method_context_t hctx, bufferlist *in,
 static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in,
                                   bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   cls_rgw_lc_list_entries_op op;
   auto in_iter = in->cbegin();
   try {
@@ -4033,7 +4052,7 @@ static int rgw_cls_lc_list_entries(cls_method_context_t hctx, bufferlist *in,
 
 static int rgw_cls_lc_put_head(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_lc_put_head_op op;
@@ -4052,7 +4071,7 @@ static int rgw_cls_lc_put_head(cls_method_context_t hctx, bufferlist *in, buffer
 
 static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in,  bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   bufferlist bl;
   int ret = cls_cxx_map_read_header(hctx, &bl);
   if (ret < 0)
@@ -4063,7 +4082,7 @@ static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in,  buffe
     try {
       decode(head, iter);
     } catch (ceph::buffer::error& err) {
-      CLS_LOG(0, "ERROR: rgw_cls_lc_get_head(): failed to decode entry %s\n",err.what());
+      CLS_LOG(0, "ERROR: rgw_cls_lc_get_head(): failed to decode entry %s",err.what());
       return -EINVAL;
     }
   } else {
@@ -4078,7 +4097,7 @@ static int rgw_cls_lc_get_head(cls_method_context_t hctx, bufferlist *in,  buffe
 
 static int rgw_reshard_add(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_reshard_add_op op;
@@ -4106,7 +4125,7 @@ static int rgw_reshard_add(cls_method_context_t hctx, bufferlist *in, bufferlist
 
 static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   cls_rgw_reshard_list_op op;
   auto in_iter = in->cbegin();
   try {
@@ -4142,7 +4161,7 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis
 
 static int rgw_reshard_get(cls_method_context_t hctx, bufferlist *in,  bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_reshard_get_op op;
@@ -4169,7 +4188,7 @@ static int rgw_reshard_get(cls_method_context_t hctx, bufferlist *in,  bufferlis
 
 static int rgw_reshard_remove(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   auto in_iter = in->cbegin();
 
   cls_rgw_reshard_remove_op op;
@@ -4203,7 +4222,7 @@ static int rgw_reshard_remove(cls_method_context_t hctx, bufferlist *in, bufferl
 
 static int rgw_set_bucket_resharding(cls_method_context_t hctx, bufferlist *in,  bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   cls_rgw_set_bucket_resharding_op op;
 
   auto in_iter = in->cbegin();
@@ -4217,7 +4236,7 @@ static int rgw_set_bucket_resharding(cls_method_context_t hctx, bufferlist *in,
   rgw_bucket_dir_header header;
   int rc = read_bucket_header(hctx, &header);
   if (rc < 0) {
-    CLS_LOG(1, "ERROR: %s(): failed to read header\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to read header", __func__);
     return rc;
   }
 
@@ -4228,7 +4247,7 @@ static int rgw_set_bucket_resharding(cls_method_context_t hctx, bufferlist *in,
 
 static int rgw_clear_bucket_resharding(cls_method_context_t hctx, bufferlist *in,  bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   cls_rgw_clear_bucket_resharding_op op;
 
   auto in_iter = in->cbegin();
@@ -4242,7 +4261,7 @@ static int rgw_clear_bucket_resharding(cls_method_context_t hctx, bufferlist *in
   rgw_bucket_dir_header header;
   int rc = read_bucket_header(hctx, &header);
   if (rc < 0) {
-    CLS_LOG(1, "ERROR: %s(): failed to read header\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to read header", __func__);
     return rc;
   }
   header.new_instance.clear();
@@ -4252,21 +4271,21 @@ static int rgw_clear_bucket_resharding(cls_method_context_t hctx, bufferlist *in
 
 static int rgw_guard_bucket_resharding(cls_method_context_t hctx, bufferlist *in,  bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   cls_rgw_guard_bucket_resharding_op op;
 
   auto in_iter = in->cbegin();
   try {
     decode(op, in_iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(1, "ERROR: %s(): failed to decode entry\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to decode entry", __func__);
     return -EINVAL;
   }
 
   rgw_bucket_dir_header header;
   int rc = read_bucket_header(hctx, &header);
   if (rc < 0) {
-    CLS_LOG(1, "ERROR: %s(): failed to read header\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to read header", __func__);
     return rc;
   }
 
@@ -4280,21 +4299,21 @@ static int rgw_guard_bucket_resharding(cls_method_context_t hctx, bufferlist *in
 static int rgw_get_bucket_resharding(cls_method_context_t hctx,
                                     bufferlist *in, bufferlist *out)
 {
-  CLS_LOG(10, "entered %s()\n", __func__);
+  CLS_LOG(10, "entered %s", __func__);
   cls_rgw_get_bucket_resharding_op op;
 
   auto in_iter = in->cbegin();
   try {
     decode(op, in_iter);
   } catch (ceph::buffer::error& err) {
-    CLS_LOG(1, "ERROR: %s(): failed to decode entry\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to decode entry", __func__);
     return -EINVAL;
   }
 
   rgw_bucket_dir_header header;
   int rc = read_bucket_header(hctx, &header);
   if (rc < 0) {
-    CLS_LOG(1, "ERROR: %s(): failed to read header\n", __func__);
+    CLS_LOG(1, "ERROR: %s: failed to read header", __func__);
     return rc;
   }