Set log levels on many existing log messages. A huge thanks to James Martelletti for going through all the log calls to do this.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1173 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2006-04-16 06:05:53 +00:00
1 parent fd7bf0eaaa
commit 026e8d39ca
34 files changed
+387 -387

No files matched your search

+48 -48
View File
@@ -120,7 +120,7 @@ SWITCH_DECLARE(switch_core_db *) switch_core_db_open_file(char *filename)
db_pick_path(filename, path, sizeof(path));
if (switch_core_db_open(path, &db)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SQL ERR [%s]\n", switch_core_db_errmsg(db));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR [%s]\n", switch_core_db_errmsg(db));
switch_core_db_close(db);
db = NULL;
}
@@ -297,7 +297,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *
memset(codec, 0, sizeof(*codec));
if ((codec_interface = switch_loadable_module_get_codec_interface(codec_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "invalid codec %s!\n", codec_name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid codec %s!\n", codec_name);
return SWITCH_STATUS_GENERR;
}
@@ -328,7 +328,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *
return SWITCH_STATUS_SUCCESS;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec %s Exists but not then desired implementation.\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Codec %s Exists but not then desired implementation.\n",
codec_name);
}
@@ -349,12 +349,12 @@ SWITCH_DECLARE(switch_status) switch_core_codec_encode(switch_codec *codec,
assert(decoded_data != NULL);
if (!codec->implementation) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec is not initilized!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec is not initilized!\n");
return SWITCH_STATUS_GENERR;
}
if (!switch_test_flag(codec, SWITCH_CODEC_FLAG_ENCODE)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec's encoder is not initilized!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec's encoder is not initilized!\n");
return SWITCH_STATUS_GENERR;
}
@@ -383,12 +383,12 @@ SWITCH_DECLARE(switch_status) switch_core_codec_decode(switch_codec *codec,
if (!codec->implementation) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec is not initilized!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec is not initilized!\n");
return SWITCH_STATUS_GENERR;
}
if (!switch_test_flag(codec, SWITCH_CODEC_FLAG_DECODE)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec's decoder is not initilized!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec's decoder is not initilized!\n");
return SWITCH_STATUS_GENERR;
}
@@ -406,7 +406,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec)
assert(codec != NULL);
if (!codec->implementation) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec is not initilized!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec is not initilized!\n");
return SWITCH_STATUS_GENERR;
}
@@ -426,13 +426,13 @@ SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char
switch_status status;
if ((ext = strrchr(file_path, '.')) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid Format\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Format\n");
return SWITCH_STATUS_FALSE;
}
ext++;
if ((fh->file_interface = switch_loadable_module_get_file_interface(ext)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "invalid file format [%s]!\n", ext);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid file format [%s]!\n", ext);
return SWITCH_STATUS_GENERR;
}
@@ -484,7 +484,7 @@ SWITCH_DECLARE(switch_status) switch_core_directory_open(switch_directory_handle
switch_status status;
if ((dh->directory_interface = switch_loadable_module_get_directory_interface(module_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "invalid directory module [%s]!\n", module_name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid directory module [%s]!\n", module_name);
return SWITCH_STATUS_GENERR;
}
@@ -530,7 +530,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
switch_status status;
if ((sh->speech_interface = switch_loadable_module_get_speech_interface(module_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "invalid speech module [%s]!\n", module_name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid speech module [%s]!\n", module_name);
return SWITCH_STATUS_GENERR;
}
@@ -592,7 +592,7 @@ SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *
switch_status status;
memset(timer, 0, sizeof(*timer));
if ((timer_interface = switch_loadable_module_get_timer_interface(timer_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "invalid timer %s!\n", timer_name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid timer %s!\n", timer_name);
return SWITCH_STATUS_GENERR;
}
@@ -618,7 +618,7 @@ SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *
SWITCH_DECLARE(int) switch_core_timer_next(switch_timer *timer)
{
if (!timer->timer_interface) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Timer is not initilized!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer is not initilized!\n");
return SWITCH_STATUS_GENERR;
}
@@ -634,7 +634,7 @@ SWITCH_DECLARE(int) switch_core_timer_next(switch_timer *timer)
SWITCH_DECLARE(switch_status) switch_core_timer_destroy(switch_timer *timer)
{
if (!timer->timer_interface) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Timer is not initilized!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer is not initilized!\n");
return SWITCH_STATUS_GENERR;
}
@@ -852,7 +852,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s
const switch_endpoint_interface *endpoint_interface;
if ((endpoint_interface = switch_loadable_module_get_endpoint_interface(endpoint_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not locate channel type %s\n", endpoint_name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not locate channel type %s\n", endpoint_name);
return SWITCH_STATUS_FALSE;
}
@@ -1052,7 +1052,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_read_frame(switch_core_session
status = SWITCH_STATUS_SUCCESS;
break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec %s decoder error!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s decoder error!\n",
session->read_codec->codec_interface->interface_name);
return status;
@@ -1124,7 +1124,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_read_frame(switch_core_session
status = SWITCH_STATUS_SUCCESS;
break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec %s encoder error!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s encoder error!\n",
session->read_codec->codec_interface->interface_name);
*frame = NULL;
status = SWITCH_STATUS_GENERR;
@@ -1226,7 +1226,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_sessio
status = SWITCH_STATUS_SUCCESS;
break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec %s decoder error!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s decoder error!\n",
frame->codec->codec_interface->interface_name);
return status;
}
@@ -1260,12 +1260,12 @@ SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_sessio
if ((status =
switch_buffer_create(session->pool, &session->raw_write_buffer,
bytes)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Buffer Failed!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Buffer Failed!\n");
return status;
}
}
if (!(switch_buffer_write(session->raw_write_buffer, write_frame->data, write_frame->datalen))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Buffer Failed!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Buffer Failed!\n");
return SWITCH_STATUS_MEMERR;
}
}
@@ -1295,7 +1295,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_sessio
status = SWITCH_STATUS_SUCCESS;
break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec %s encoder error!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s encoder error!\n",
session->read_codec->codec_interface->interface_name);
write_frame = NULL;
return status;
@@ -1351,7 +1351,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_sessio
status = SWITCH_STATUS_SUCCESS;
break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec %s encoder error!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s encoder error!\n",
session->read_codec->codec_interface->interface_name);
write_frame = NULL;
return status;
@@ -1697,7 +1697,7 @@ static void switch_core_standard_on_ring(switch_core_session *session)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard RING %s\n", switch_channel_get_name(session->channel));
if ((caller_profile = switch_channel_get_caller_profile(session->channel)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't get profile!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't get profile!\n");
switch_channel_set_state(session->channel, CS_HANGUP);
} else {
if (!switch_strlen_zero(caller_profile->dialplan)) {
@@ -1706,7 +1706,7 @@ static void switch_core_standard_on_ring(switch_core_session *session)
if (!dialplan_interface) {
if (switch_channel_test_flag(session->channel, CF_OUTBOUND)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No Dialplan, changing state to TRANSMIT\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No Dialplan, changing state to TRANSMIT\n");
switch_channel_set_state(session->channel, CS_TRANSMIT);
return;
}
@@ -1727,26 +1727,26 @@ static void switch_core_standard_on_execute(switch_core_session *session)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard EXECUTE\n");
if ((extension = switch_channel_get_caller_extension(session->channel)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No Extension!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Extension!\n");
switch_channel_set_state(session->channel, CS_HANGUP);
return;
}
while (switch_channel_get_state(session->channel) == CS_EXECUTE && extension->current_application) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Execute %s(%s)\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Execute %s(%s)\n",
extension->current_application->application_name,
extension->current_application->application_data);
if (
(application_interface =
switch_loadable_module_get_application_interface(extension->current_application->application_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid Application %s\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Application %s\n",
extension->current_application->application_name);
switch_channel_set_state(session->channel, CS_HANGUP);
return;
}
if (!application_interface->application_function) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No Function for %s\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Function for %s\n",
extension->current_application->application_name);
switch_channel_set_state(session->channel, CS_HANGUP);
return;
@@ -1847,12 +1847,12 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
switch (state) {
case CS_NEW: /* Just created, Waiting for first instructions */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State NEW\n", switch_channel_get_name(session->channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "(%s) State NEW\n", switch_channel_get_name(session->channel));
break;
case CS_DONE:
continue;
case CS_HANGUP: /* Deactivate and end the thread */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State HANGUP\n", switch_channel_get_name(session->channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "(%s) State HANGUP\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_hangup ||
(driver_state_handler->on_hangup &&
driver_state_handler->on_hangup(session) == SWITCH_STATUS_SUCCESS &&
@@ -1891,7 +1891,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
midstate = switch_channel_get_state(session->channel);
break;
case CS_INIT: /* Basic setup tasks */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State INIT\n", switch_channel_get_name(session->channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "(%s) State INIT\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_init ||
(driver_state_handler->on_init &&
driver_state_handler->on_init(session) == SWITCH_STATUS_SUCCESS &&
@@ -1927,7 +1927,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
}
break;
case CS_RING: /* Look for a dialplan and find something to do */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State RING\n", switch_channel_get_name(session->channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "(%s) State RING\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_ring ||
(driver_state_handler->on_ring &&
driver_state_handler->on_ring(session) == SWITCH_STATUS_SUCCESS &&
@@ -1963,7 +1963,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
}
break;
case CS_EXECUTE: /* Execute an Operation */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State EXECUTE\n", switch_channel_get_name(session->channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "(%s) State EXECUTE\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_execute ||
(driver_state_handler->on_execute &&
driver_state_handler->on_execute(session) == SWITCH_STATUS_SUCCESS &&
@@ -1999,7 +1999,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
}
break;
case CS_LOOPBACK: /* loop all data back to source */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State LOOPBACK\n", switch_channel_get_name(session->channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "(%s) State LOOPBACK\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_loopback ||
(driver_state_handler->on_loopback &&
driver_state_handler->on_loopback(session) == SWITCH_STATUS_SUCCESS &&
@@ -2035,7 +2035,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
}
break;
case CS_TRANSMIT: /* send/recieve data to/from another channel */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State TRANSMIT\n", switch_channel_get_name(session->channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "(%s) State TRANSMIT\n", switch_channel_get_name(session->channel));
if (!driver_state_handler->on_transmit ||
(driver_state_handler->on_transmit &&
driver_state_handler->on_transmit(session) == SWITCH_STATUS_SUCCESS &&
@@ -2163,7 +2163,7 @@ SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void
mypool = pool ? 0 : 1;
if (!pool && switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not allocate memory pool\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate memory pool\n");
return;
}
@@ -2171,7 +2171,7 @@ SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void
switch_threadattr_detach_set(thd_attr, 1);
if ((ts = switch_core_alloc(pool, sizeof(*ts))) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not allocate memory\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate memory\n");
} else {
if (mypool) {
ts->pool = pool;
@@ -2194,7 +2194,7 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread *thread
switch_core_hash_insert(runtime.session_table, session->uuid_str, session);
switch_core_session_run(session);
switch_core_hash_delete(runtime.session_table, session->uuid_str);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Session %u (%s) Ended\n", session->id, switch_channel_get_name(session->channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Session %u (%s) Ended\n", session->id, switch_channel_get_name(session->channel));
switch_core_session_destroy(&session);
return NULL;
}
@@ -2257,18 +2257,18 @@ SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_e
if (pool) {
usepool = pool;
} else if (switch_core_new_memory_pool(&usepool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not allocate memory pool\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate memory pool\n");
return NULL;
}
if ((session = switch_core_alloc(usepool, sizeof(switch_core_session))) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not allocate session\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate session\n");
apr_pool_destroy(usepool);
return NULL;
}
if (switch_channel_alloc(&session->channel, usepool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not allocate channel structure\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate channel structure\n");
apr_pool_destroy(usepool);
return NULL;
}
@@ -2306,7 +2306,7 @@ SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *
const switch_endpoint_interface *endpoint_interface;
if ((endpoint_interface = switch_loadable_module_get_endpoint_interface(endpoint_name)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not locate channel type %s\n", endpoint_name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not locate channel type %s\n", endpoint_name);
return NULL;
}
@@ -2421,7 +2421,7 @@ static void core_event_handler(switch_event *event)
&errmsg
);
if (errmsg) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SQL ERR [%s]\n", errmsg);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR [%s]\n", errmsg);
switch_core_db_free(errmsg);
switch_yield(100000);
max--;
@@ -2472,7 +2472,7 @@ SWITCH_DECLARE(switch_status) switch_core_init(char *console)
if (apr_pool_create(&runtime.memory_pool, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Could not allocate memory pool\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate memory pool\n");
switch_core_destroy();
return SWITCH_STATUS_MEMERR;
}
@@ -2500,7 +2500,7 @@ SWITCH_DECLARE(switch_status) switch_core_init(char *console)
/* Activate SQL database */
if ((runtime.db = switch_core_db_handle()) == 0 ) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Error Opening DB!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
} else {
char create_channels_sql[] =
"CREATE TABLE channels (\n"
@@ -2530,7 +2530,7 @@ SWITCH_DECLARE(switch_status) switch_core_init(char *console)
" callee_uuid VARCHAR(255)\n"
");\n";
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Opening DB\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Opening DB\n");
switch_core_db_exec(runtime.db, "drop table channels", NULL, NULL, NULL);
switch_core_db_exec(runtime.db, "drop table calls", NULL, NULL, NULL);
switch_core_db_exec(runtime.db, create_channels_sql, NULL, NULL, NULL);
@@ -2538,7 +2538,7 @@ SWITCH_DECLARE(switch_status) switch_core_init(char *console)
if (switch_event_bind("core_db", SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL) !=
SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Couldn't bind event handler!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind event handler!\n");
}
}