diff options
author | Andreas Schneider <asn@samba.org> | 2018-11-07 14:14:05 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-11-08 11:03:11 +0100 |
commit | 2d512b278e5905964c1294c587ba405678c3d10c (patch) | |
tree | a891cf0886d58e04d3ad2faadc5545c077865929 /ctdb/common | |
parent | 71ef09c1afdbf967b829cb66b33c3a5cb1c18ba0 (diff) | |
download | samba-2d512b278e5905964c1294c587ba405678c3d10c.tar.gz |
debug: Use debuglevel_(get|set) function
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Nov 8 11:03:11 CET 2018 on sn-devel-144
Diffstat (limited to 'ctdb/common')
-rw-r--r-- | ctdb/common/conf_tool.c | 6 | ||||
-rw-r--r-- | ctdb/common/logging.c | 4 | ||||
-rw-r--r-- | ctdb/common/path_tool.c | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/ctdb/common/conf_tool.c b/ctdb/common/conf_tool.c index e6020c504e6..8e0753eb787 100644 --- a/ctdb/common/conf_tool.c +++ b/ctdb/common/conf_tool.c @@ -276,6 +276,7 @@ int main(int argc, const char **argv) TALLOC_CTX *mem_ctx; struct conf_tool_context *ctx; int ret, result; + int level; bool ok; mem_ctx = talloc_new(NULL); @@ -297,10 +298,11 @@ int main(int argc, const char **argv) } setup_logging("ctdb-config", DEBUG_STDERR); - ok = debug_level_parse(conf_data.debug, &DEBUGLEVEL); + ok = debug_level_parse(conf_data.debug, &level); if (!ok) { - DEBUGLEVEL = DEBUG_ERR; + level = DEBUG_ERR; } + debuglevel_set(level); ret = conf_tool_run(ctx, &result); if (ret != 0) { diff --git a/ctdb/common/logging.c b/ctdb/common/logging.c index dc8c4f75058..aaa93216ef5 100644 --- a/ctdb/common/logging.c +++ b/ctdb/common/logging.c @@ -674,6 +674,7 @@ int logging_init(TALLOC_CTX *mem_ctx, const char *logging, { struct log_backend *backend = NULL; char *option = NULL; + int level; int ret; setup_logging(app_name, DEBUG_STDERR); @@ -681,9 +682,10 @@ int logging_init(TALLOC_CTX *mem_ctx, const char *logging, if (debug_level == NULL) { debug_level = getenv("CTDB_DEBUGLEVEL"); } - if (! debug_level_parse(debug_level, &DEBUGLEVEL)) { + if (! debug_level_parse(debug_level, &level)) { return EINVAL; } + debuglevel_set(level); if (logging == NULL) { logging = getenv("CTDB_LOGGING"); diff --git a/ctdb/common/path_tool.c b/ctdb/common/path_tool.c index 1c60b023c42..a19afa9b0c3 100644 --- a/ctdb/common/path_tool.c +++ b/ctdb/common/path_tool.c @@ -365,7 +365,7 @@ int main(int argc, const char **argv) } setup_logging("ctdb-path", DEBUG_STDERR); - DEBUGLEVEL = DEBUG_ERR; + debuglevel_set(DEBUG_ERR); ret = path_tool_run(ctx, &result); if (ret != 0) { |