From: J. Eric Ivancich Date: Thu, 11 Nov 2021 16:10:17 +0000 (-0500) Subject: rgw: add ability to easily display ListParams X-Git-Tag: v17.1.0~427^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=037ce8c4dd3d65eeccb982fba45bb18ec5dc6f84;p=ceph.git rgw: add ability to easily display ListParams 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 --- diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 6bad56ceb32e..776410145f25 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -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