Replace direct checks of option_debug with DEBUG_ATLEAST macro.

Checking option_debug directly is incorrect as it ignores file/module
specific debug settings.  This system-wide change replaces nearly all
direct checks for option_debug with the DEBUG_ATLEAST macro.

Change-Id: Ic342d4799a945dbc40ac085ac142681094a4ebf0
This commit is contained in:
Corey Farrell
2018-03-07 01:29:13 -05:00
parent 7f864dbc36
commit b81eadcefc
16 changed files with 88 additions and 89 deletions

View File

@@ -534,18 +534,18 @@ static int process_my_load_module(struct ast_config *cfg)
if ((tmp = ast_variable_retrieve(cfg, "global", "show_user_defined"))) {
cel_show_user_def = ast_true(tmp) ? 1 : 0;
}
if (option_debug) {
if (DEBUG_ATLEAST(3)) {
if (ast_strlen_zero(pghostname)) {
ast_debug(3, "cel_pgsql: using default unix socket\n");
ast_log(LOG_DEBUG, "cel_pgsql: using default unix socket\n");
} else {
ast_debug(3, "cel_pgsql: got hostname of %s\n", pghostname);
ast_log(LOG_DEBUG, "cel_pgsql: got hostname of %s\n", pghostname);
}
ast_debug(3, "cel_pgsql: got port of %s\n", pgdbport);
ast_debug(3, "cel_pgsql: got user of %s\n", pgdbuser);
ast_debug(3, "cel_pgsql: got dbname of %s\n", pgdbname);
ast_debug(3, "cel_pgsql: got password of %s\n", pgpassword);
ast_debug(3, "cel_pgsql: got sql table name of %s\n", table);
ast_debug(3, "cel_pgsql: got show_user_defined of %s\n",
ast_log(LOG_DEBUG, "cel_pgsql: got port of %s\n", pgdbport);
ast_log(LOG_DEBUG, "cel_pgsql: got user of %s\n", pgdbuser);
ast_log(LOG_DEBUG, "cel_pgsql: got dbname of %s\n", pgdbname);
ast_log(LOG_DEBUG, "cel_pgsql: got password of %s\n", pgpassword);
ast_log(LOG_DEBUG, "cel_pgsql: got sql table name of %s\n", table);
ast_log(LOG_DEBUG, "cel_pgsql: got show_user_defined of %s\n",
cel_show_user_def ? "Yes" : "No");
}