]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add debug-level to switch.conf.xml and tweak a few debugs
authorBrian West <brian@freeswitch.org>
Sat, 21 Nov 2009 06:18:56 +0000 (06:18 +0000)
committerBrian West <brian@freeswitch.org>
Sat, 21 Nov 2009 06:18:56 +0000 (06:18 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15595 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core.c
src/switch_odbc.c

index 6eea4e24684ff27b22fa76937f0a33da03844881..7a53ad685f6b1f5225d5b7fbeacdcb6d4ff1e983 100644 (file)
@@ -1392,6 +1392,11 @@ static void switch_load_core_config(const char *file)
                                        rlp.rlim_max = RLIM_INFINITY;
                                        setrlimit(RLIMIT_CORE, &rlp);
 #endif
+                               } else if (!strcasecmp(var, "debug-level")) {
+                                       int tmp = atoi(val);
+                                       if (tmp > -1 && tmp < 11) {
+                                               switch_core_session_ctl(SCSC_DEBUG_LEVEL, &tmp);
+                                       }
                                } else if (!strcasecmp(var, "colorize-console") && switch_true(val)) {
                                        runtime.colorize_console = SWITCH_TRUE;
                                } else if (!strcasecmp(var, "mailer-app") && !zstr(val)) {
index 89a03d95bff35788f400d636ac34a2fae0362b50..f29cb36ba0a7cdf9705b58fedd519828b688f08f 100644 (file)
@@ -270,14 +270,14 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_connect(switch_odbc_hand
                result = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &handle->env);
 
                if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Error AllocHandle\n");
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error AllocHandle\n");
                        return SWITCH_ODBC_FAIL;
                }
 
                result = SQLSetEnvAttr(handle->env, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0);
 
                if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Error SetEnv\n");
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error SetEnv\n");
                        SQLFreeHandle(SQL_HANDLE_ENV, handle->env);
                        return SWITCH_ODBC_FAIL;
                }
@@ -285,7 +285,7 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_connect(switch_odbc_hand
                result = SQLAllocHandle(SQL_HANDLE_DBC, handle->env, &handle->con);
 
                if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Error AllocHDB %d\n", result);
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error AllocHDB %d\n", result);
                        SQLFreeHandle(SQL_HANDLE_ENV, handle->env);
                        return SWITCH_ODBC_FAIL;
                }
@@ -293,10 +293,10 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_connect(switch_odbc_hand
        }
        if (handle->state == SWITCH_ODBC_STATE_CONNECTED) {
                switch_odbc_handle_disconnect(handle);
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Re-connecting %s\n", handle->dsn);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Re-connecting %s\n", handle->dsn);
        }
 
-       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connecting %s\n", handle->dsn);
+       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Connecting %s\n", handle->dsn);
 
        if (!strstr(handle->dsn, "DRIVER")) {
                result = SQLConnect(handle->con, (SQLCHAR *) handle->dsn, SQL_NTS, (SQLCHAR *) handle->username, SQL_NTS, (SQLCHAR *) handle->password, SQL_NTS);
@@ -333,7 +333,7 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_connect(switch_odbc_hand
                handle->is_firebird = FALSE;
        }
        
-       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connected to [%s]\n", handle->dsn);
+       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Connected to [%s]\n", handle->dsn);
        handle->state = SWITCH_ODBC_STATE_CONNECTED;
        return SWITCH_ODBC_SUCCESS;
 #else