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 15:36:17 -05:00
parent 9040057db3
commit c8a521b6c8
16 changed files with 88 additions and 89 deletions

View File

@@ -1528,16 +1528,16 @@ static int parse_config(int is_reload)
ast_config_destroy(config);
if (option_debug) {
if (DEBUG_ATLEAST(1)) {
if (!ast_strlen_zero(dbhost)) {
ast_debug(1, "PostgreSQL RealTime Host: %s\n", dbhost);
ast_debug(1, "PostgreSQL RealTime Port: %i\n", dbport);
ast_log(LOG_DEBUG, "PostgreSQL RealTime Host: %s\n", dbhost);
ast_log(LOG_DEBUG, "PostgreSQL RealTime Port: %i\n", dbport);
} else {
ast_debug(1, "PostgreSQL RealTime Socket: %s\n", dbsock);
ast_log(LOG_DEBUG, "PostgreSQL RealTime Socket: %s\n", dbsock);
}
ast_debug(1, "PostgreSQL RealTime User: %s\n", dbuser);
ast_debug(1, "PostgreSQL RealTime Password: %s\n", dbpass);
ast_debug(1, "PostgreSQL RealTime DBName: %s\n", dbname);
ast_log(LOG_DEBUG, "PostgreSQL RealTime User: %s\n", dbuser);
ast_log(LOG_DEBUG, "PostgreSQL RealTime Password: %s\n", dbpass);
ast_log(LOG_DEBUG, "PostgreSQL RealTime DBName: %s\n", dbname);
}
if (!pgsql_reconnect(NULL)) {