rgw: add global prefix provider for radosgw-admin
authorCasey Bodley <cbodley@redhat.com>
Mon, 27 Aug 2018 23:55:14 +0000 (19:55 -0400)
committerAli Maredia <amaredia@redhat.com>
Wed, 26 Sep 2018 20:36:55 +0000 (16:36 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 9a5dbc81b774d0be4b51f39e37bcfa15f3b36db8)

src/rgw/rgw_admin.cc

index b18acfcf4f88ede2e0f60b1d83a5833da5fcaec7..2d2990939ef873ffcdda8edee10efd67dc3abaea 100644 (file)
 
 static RGWRados *store = NULL;
 
+static const DoutPrefixProvider* dpp() {
+  struct GlobalPrefix : public DoutPrefixProvider {
+    CephContext *get_cct() const override { return store->ctx(); }
+    unsigned get_subsys() const override { return dout_subsys; }
+    std::ostream& gen_prefix(std::ostream& out) const override { return out; }
+  };
+  static GlobalPrefix global_dpp;
+  return &global_dpp;
+}
+
 void usage()
 {
   cout << "usage: radosgw-admin <cmd> [options...]" << std::endl;