]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add optional level argument to info app to choose the log level it logs on
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Aug 2009 16:29:47 +0000 (16:29 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Aug 2009 16:29:47 +0000 (16:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14643 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_dptools/mod_dptools.c

index 02ff01a58ccc8b9ededddb9936d6117fde092fcf..8a8f0279c7b81ee6bf07743250c241b1f76a6e48 100644 (file)
@@ -938,12 +938,17 @@ SWITCH_STANDARD_APP(info_function)
 {
        switch_event_t *event;
        char *buf;
+       int level = SWITCH_LOG_INFO;
+
+       if (data) {
+               level = switch_log_str2level(data);
+       }
 
        if (switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) {
                switch_channel_event_set_data(switch_core_session_get_channel(session), event);
                switch_event_serialize(event, &buf, SWITCH_FALSE);
                switch_assert(buf);
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "CHANNEL_DATA:\n%s\n", buf);
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), level, "CHANNEL_DATA:\n%s\n", buf);
                switch_event_destroy(&event);
                free(buf);
        }