From 09b23b42d1e0184d7783dc69fd1e63d6d5d2acf0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 4 Oct 2011 15:40:10 -0700 Subject: [PATCH] rgw: rgw_log -> debug_rgw Normalize with the rest of the code base. Also, 'rgw log' might be confused with 'log file'. Signed-off-by: Sage Weil --- src/common/config_opts.h | 2 +- src/rgw/librgw.cc | 3 +-- src/rgw/rgw_access.cc | 3 +-- src/rgw/rgw_acl.cc | 3 +-- src/rgw/rgw_aclparser.cc | 3 +-- src/rgw/rgw_admin.cc | 3 +-- src/rgw/rgw_bucket.cc | 3 +-- src/rgw/rgw_cache.cc | 3 +-- src/rgw/rgw_common.cc | 3 +-- src/rgw/rgw_env.cc | 3 +-- src/rgw/rgw_formats.cc | 3 +-- src/rgw/rgw_fs.cc | 3 +-- src/rgw/rgw_log.cc | 3 +-- src/rgw/rgw_main.cc | 6 +----- src/rgw/rgw_multi.cc | 3 +-- src/rgw/rgw_multiparser.cc | 3 +-- src/rgw/rgw_op.cc | 11 +++++------ src/rgw/rgw_rados.cc | 5 ++--- src/rgw/rgw_rest.cc | 3 +-- src/rgw/rgw_rest_s3.cc | 3 +-- src/rgw/rgw_rest_swift.cc | 3 +-- src/rgw/rgw_swift.cc | 3 +-- src/rgw/rgw_swift_auth.cc | 3 +-- src/rgw/rgw_tools.cc | 3 +-- src/rgw/rgw_user.cc | 3 +-- src/rgw/rgw_xml.cc | 3 +-- 26 files changed, 31 insertions(+), 59 deletions(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index e97d97d3c3d87..b7aea9062dcfe 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -321,7 +321,7 @@ OPTION(bdev_iov_max, OPT_INT, 512) // max # iov's to collect into a s OPTION(bdev_debug_check_io_overlap, OPT_BOOL, true) // [DEBUG] check for any pending io overlaps OPTION(bdev_fake_mb, OPT_INT, 0) OPTION(bdev_fake_max_mb, OPT_INT, 0) -OPTION(rgw_log, OPT_INT, 20) // log level for the Rados gateway +OPTION(debug_rgw, OPT_INT, 20) // log level for the Rados gateway OPTION(rgw_cache_enabled, OPT_BOOL, false) // rgw cache enabled OPTION(rgw_cache_lru_size, OPT_INT, 10000) // num of entries in rgw cache OPTION(rgw_socket_path, OPT_STR, "") // path to unix domain socket, if not specified, rgw will not run as external fcgi diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc index 87021159aac2c..8fd3e20ad60c0 100644 --- a/src/rgw/librgw.cc +++ b/src/rgw/librgw.cc @@ -25,8 +25,7 @@ #include #include -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw int librgw_create(librgw_t *rgw, const char * const id) { diff --git a/src/rgw/rgw_access.cc b/src/rgw/rgw_access.cc index 4a5d2542b3415..17b385c49d328 100644 --- a/src/rgw/rgw_access.cc +++ b/src/rgw/rgw_access.cc @@ -4,8 +4,7 @@ #include "rgw_rados.h" #include "rgw_cache.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw static RGWCache cached_fs_provider; static RGWCache cached_rados_provider; diff --git a/src/rgw/rgw_acl.cc b/src/rgw/rgw_acl.cc index 7ee2719dd564f..1ab64194de3a0 100644 --- a/src/rgw/rgw_acl.cc +++ b/src/rgw/rgw_acl.cc @@ -8,8 +8,7 @@ #include "rgw_acl.h" #include "rgw_user.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; diff --git a/src/rgw/rgw_aclparser.cc b/src/rgw/rgw_aclparser.cc index 9d35f9e592504..7ac400f05d5e0 100644 --- a/src/rgw/rgw_aclparser.cc +++ b/src/rgw/rgw_aclparser.cc @@ -7,8 +7,7 @@ #include #include -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw int main(int argc, char **argv) { RGWACLXMLParser parser; diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index ba732f7e59f90..45ca4be72c235 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -21,8 +21,7 @@ using namespace std; #include "rgw_formats.h" #include "auth/Crypto.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw #define SECRET_KEY_LEN 40 #define PUBLIC_ID_LEN 20 diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index beddf015261b7..597ca9821f50a 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -10,8 +10,7 @@ #include "auth/Crypto.h" // get_random_bytes() -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw static rgw_bucket pi_buckets(BUCKETS_POOL_NAME); diff --git a/src/rgw/rgw_cache.cc b/src/rgw/rgw_cache.cc index dbc8a71478778..0fe9a3dd6ee51 100644 --- a/src/rgw/rgw_cache.cc +++ b/src/rgw/rgw_cache.cc @@ -2,8 +2,7 @@ #include -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index dec537950c07e..00713d7e9d9f9 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -12,8 +12,7 @@ #include -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace ceph::crypto; diff --git a/src/rgw/rgw_env.cc b/src/rgw/rgw_env.cc index 7d04d85ca0cbc..3047de9e859a1 100644 --- a/src/rgw/rgw_env.cc +++ b/src/rgw/rgw_env.cc @@ -4,8 +4,7 @@ #include #include -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw RGWEnv::RGWEnv() { diff --git a/src/rgw/rgw_formats.cc b/src/rgw/rgw_formats.cc index 32e2a6a1b42fc..b392224555ebb 100644 --- a/src/rgw/rgw_formats.cc +++ b/src/rgw/rgw_formats.cc @@ -19,8 +19,7 @@ #define LARGE_SIZE 8192 -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw RGWFormatter_Plain::RGWFormatter_Plain() : buf(NULL), len(0), max_len(0), min_stack_level(0) diff --git a/src/rgw/rgw_fs.cc b/src/rgw/rgw_fs.cc index e04c3d3452a2f..a304c4a0e7e56 100644 --- a/src/rgw/rgw_fs.cc +++ b/src/rgw/rgw_fs.cc @@ -18,8 +18,7 @@ #include #include -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index 27659c2a98585..817893e8d0024 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -5,8 +5,7 @@ #include "rgw_access.h" #include "rgw_bucket.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw static rgw_bucket log_bucket(RGW_LOG_POOL_NAME); diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 5244590336ee4..efb9b6df3b812 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -37,8 +37,7 @@ #include "include/types.h" #include "common/BackTrace.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; @@ -163,7 +162,6 @@ void RGWProcess::handle_request(FCGX_Request *fcgx) RGWEnv rgw_env; dout(0) << "====== starting new request fcgx=" << hex << fcgx << dec << " =====" << dendl; - dout(0) << "rgw_log = " << g_conf->rgw_log << dendl; rgw_env.init(fcgx->envp); @@ -262,8 +260,6 @@ int main(int argc, const char **argv) sighandler_usr1 = signal(SIGUSR1, godown_handler); sighandler_alrm = signal(SIGALRM, godown_alarm); - dout(0) << "rgw_log = " << g_conf->rgw_log << dendl; - FCGX_Init(); RGWStoreManager store_manager; diff --git a/src/rgw/rgw_multi.cc b/src/rgw/rgw_multi.cc index 47456756a0043..44d6ad41354a4 100644 --- a/src/rgw/rgw_multi.cc +++ b/src/rgw/rgw_multi.cc @@ -8,8 +8,7 @@ #include "rgw_xml.h" #include "rgw_multi.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; diff --git a/src/rgw/rgw_multiparser.cc b/src/rgw/rgw_multiparser.cc index 72b3bf045013e..12e12f039d04c 100644 --- a/src/rgw/rgw_multiparser.cc +++ b/src/rgw/rgw_multiparser.cc @@ -7,8 +7,7 @@ #include "rgw_multi.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index a5515a243a841..23bea4ff6b018 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -18,8 +18,7 @@ #include "rgw_log.h" #include "rgw_multi.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; using ceph::crypto::MD5; @@ -154,7 +153,7 @@ static int get_policy_from_attr(void *ctx, RGWAccessControlPolicy *policy, rgw_o dout(0) << "error: could not decode policy, caught buffer::error" << dendl; return -EIO; } - if (g_conf->rgw_log >= 15) { + if (g_conf->debug_rgw >= 15) { dout(15) << "Read AccessControlPolicy" << dendl; policy->to_xml(cerr); dout(15) << dendl; @@ -1100,7 +1099,7 @@ void RGWPutACLs::execute() goto done; } - if (g_conf->rgw_log >= 15) { + if (g_conf->debug_rgw >= 15) { dout(15) << "Old AccessControlPolicy" << dendl; policy->to_xml(cout); dout(15) << dendl; @@ -1110,7 +1109,7 @@ void RGWPutACLs::execute() if (ret < 0) goto done; - if (g_conf->rgw_log >= 15) { + if (g_conf->debug_rgw >= 15) { dout(15) << "New AccessControlPolicy" << dendl; new_policy.to_xml(cout); dout(15) << dendl; @@ -1495,7 +1494,7 @@ int RGWHandler::init(struct req_state *_s, FCGX_Request *fcgx) { s = _s; - if (g_conf->rgw_log >= 20) { + if (g_conf->debug_rgw >= 20) { char *p; for (int i=0; (p = fcgx->envp[i]); ++i) { dout(20) << p << dendl; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 3b486b621acc7..72544242f41d4 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -19,8 +19,7 @@ using namespace librados; #include #include -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; @@ -1211,7 +1210,7 @@ int RGWRados::prepare_get_obj(void *ctx, rgw_obj& obj, if (attrs) { *attrs = astate->attrset; - if (g_conf->rgw_log >= 20) { + if (g_conf->debug_rgw >= 20) { for (iter = attrs->begin(); iter != attrs->end(); ++iter) { dout(20) << "Read xattr: " << iter->first << dendl; } diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index b08efd878088c..6bca0ab7f8114 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -13,8 +13,7 @@ #include "rgw_formats.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw static void dump_status(struct req_state *s, const char *status) { diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index d90b4c93da9a3..69b932223cef7 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -10,8 +10,7 @@ #include "common/armor.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace ceph::crypto; diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index c8ef0d85d25b0..8ffdcb656c7df 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -5,8 +5,7 @@ #include -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw void RGWListBuckets_REST_SWIFT::send_response() { diff --git a/src/rgw/rgw_swift.cc b/src/rgw/rgw_swift.cc index b4c83f4aa3844..e10c035ac9b72 100644 --- a/src/rgw/rgw_swift.cc +++ b/src/rgw/rgw_swift.cc @@ -10,8 +10,7 @@ #include "rgw_swift_auth.h" #include "rgw_user.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw static size_t read_http_header(void *ptr, size_t size, size_t nmemb, void *_info) { diff --git a/src/rgw/rgw_swift_auth.cc b/src/rgw/rgw_swift_auth.cc index 256c7b7b39bad..f62f373b7ce72 100644 --- a/src/rgw/rgw_swift_auth.cc +++ b/src/rgw/rgw_swift_auth.cc @@ -6,8 +6,7 @@ #include "auth/Crypto.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace ceph::crypto; diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc index ded6308250e90..076cb2f2bd678 100644 --- a/src/rgw/rgw_tools.cc +++ b/src/rgw/rgw_tools.cc @@ -9,8 +9,7 @@ #include "rgw_tools.h" #include "rgw_bucket.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw #define READ_CHUNK_LEN (16 * 1024) diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index 0e821a010b839..d1d94c23056d7 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -11,8 +11,7 @@ #include "rgw_user.h" #include "rgw_bucket.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; diff --git a/src/rgw/rgw_xml.cc b/src/rgw/rgw_xml.cc index c47368e4716f8..197f7ec69fefe 100644 --- a/src/rgw/rgw_xml.cc +++ b/src/rgw/rgw_xml.cc @@ -8,8 +8,7 @@ #include "rgw_common.h" #include "rgw_xml.h" -#undef DOUT_CONDVAR -#define DOUT_CONDVAR(cct, x) cct->_conf->rgw_log +#define DOUT_SUBSYS rgw using namespace std; -- 2.39.5