]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add ability to easily display ListParams
authorJ. Eric Ivancich <ivancich@redhat.com>
Thu, 11 Nov 2021 16:10:17 +0000 (11:10 -0500)
committerJ. Eric Ivancich <ivancich@redhat.com>
Fri, 12 Nov 2021 16:49:46 +0000 (11:49 -0500)
During debugging it can be useful to see all the contents of
rgw::sal::Bucket::ListParams. This allows the structure to be dumped
to an output stream in human-readable format.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/rgw/rgw_sal.h

index 6bad56ceb32e2f191257bda61533fdffcd6259e2..776410145f252f2296541b11899f385e0eec7562 100644 (file)
@@ -553,6 +553,20 @@ class Bucket {
       bool list_versions{false};
       bool allow_unordered{false};
       int shard_id{RGW_NO_SHARD};
+
+      friend std::ostream& operator<<(std::ostream& out, const ListParams& p) {
+       out << "rgw::sal::Bucket::ListParams{ prefix=\"" << p.prefix <<
+         "\", delim=\"" << p.delim <<
+         "\", marker=\"" << p.marker <<
+         "\", end_marker=\"" << p.end_marker <<
+         "\", ns=\"" << p.ns <<
+         "\", enforce_ns=" << p.enforce_ns <<
+         ", list_versions=" << p.list_versions <<
+         ", allow_unordered=" << p.allow_unordered <<
+         ", shard_id=" << p.shard_id <<
+         " }";
+       return out;
+      }
     };
     /**
      * @brief Results from a bucket list operation