From 037ce8c4dd3d65eeccb982fba45bb18ec5dc6f84 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Thu, 11 Nov 2021 11:10:17 -0500 Subject: [PATCH] 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 --- src/rgw/rgw_sal.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 6bad56ceb32..776410145f2 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 -- 2.39.5