]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/dbstore: hide dbstore_log.h from rgw_main.cc
authorCasey Bodley <cbodley@redhat.com>
Thu, 13 Jan 2022 20:56:11 +0000 (15:56 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 14 Jan 2022 17:34:08 +0000 (12:34 -0500)
dbstore_log.h sets global dout_subsys/dout_prefix macros, and was
leaking into rgw_main.cc through the common/dbstore.h. this caused all
of rgw_main's log output to start with the wrong prefix "rgw dbstore: "

Fixes: https://tracker.ceph.com/issues/53177
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/store/dbstore/common/dbstore.cc
src/rgw/store/dbstore/common/dbstore.h
src/rgw/store/dbstore/dbstore_mgr.cc
src/rgw/store/dbstore/dbstore_mgr.h

index 6a56bc338a852d15c54d3c6d0e5b6abdcf2973eb..47ed9fc96f9ae211f6c324481e2c0ab8c6aea9fa 100644 (file)
@@ -24,7 +24,7 @@ int DB::Initialize(string logfile, int loglevel)
   }
 
   if (loglevel > 0) {
-    cct->_conf->subsys.set_log_level(dout_subsys, loglevel);
+    cct->_conf->subsys.set_log_level(ceph_subsys_rgw, loglevel);
   }
   if (!logfile.empty()) {
     cct->_log->set_log_file(logfile);
index 01b55908c5b73e9c3656e763a832fa66dde2b37e..4954f3519c57b5ae4ccd73abd801fa778ddaf880 100644 (file)
@@ -15,7 +15,6 @@
 #define FMT_HEADER_ONLY 1
 #include "fmt/format.h"
 #include <map>
-#include "dbstore_log.h"
 #include "rgw/rgw_sal.h"
 #include "rgw/rgw_common.h"
 #include "rgw/rgw_bucket.h"
@@ -650,7 +649,7 @@ class DBOp {
             params->lc_entry_table.c_str(),
             params->bucket_table.c_str());
 
-      ldout(params->cct, 0) << "Incorrect table type("<<type<<") specified" << dendl;
+      lsubdout(params->cct, rgw, 0) << "rgw dbstore: Incorrect table type("<<type<<") specified" << dendl;
 
       return NULL;
     }
@@ -1396,7 +1395,7 @@ class DB {
     lc_head_table(db_name+".lc_head.table"),
     lc_entry_table(db_name+".lc_entry.table"),
     cct(_cct),
-    dp(_cct, dout_subsys, "rgw DBStore backend: ")
+    dp(_cct, ceph_subsys_rgw, "rgw DBStore backend: ")
   {}
     /* DB() {}*/
 
@@ -1407,7 +1406,7 @@ class DB {
     lc_head_table(db_name+".lc_head.table"),
     lc_entry_table(db_name+".lc_entry.table"),
     cct(_cct),
-    dp(_cct, dout_subsys, "rgw DBStore backend: ")
+    dp(_cct, ceph_subsys_rgw, "rgw DBStore backend: ")
   {}
     virtual    ~DB() {}
 
index 2869c5422104f906deb95784acd384b83934c428..61e11d996370a205ac961db7252962e4f1009603 100644 (file)
@@ -2,6 +2,7 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "dbstore_mgr.h"
+#include "common/dbstore_log.h"
 
 /* Given a tenant, find and return the DBStore handle.
  * If not found and 'create' set to true, create one
index 77037552f6fc46c8003e7819e35022cbdd61cf7e..d3053e6ac7cb2301769ca119fc5ec81d6d5b39ab 100644 (file)
@@ -40,7 +40,7 @@ public:
                       CODE_ENVIRONMENT_DAEMON, CINIT_FLAG_NO_MON_CONFIG, 1)->get();
     cct->_log->set_log_file(logfile);
     cct->_log->reopen_log_file();
-    cct->_conf->subsys.set_log_level(dout_subsys, loglevel);
+    cct->_conf->subsys.set_log_level(ceph_subsys_rgw, loglevel);
   };
   ~DBStoreManager() { destroyAllHandles(); };