]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5529 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 20 Jun 2013 17:36:30 +0000 (12:36 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 20 Jun 2013 17:36:30 +0000 (12:36 -0500)
src/include/switch_cpp.h
src/switch_cpp.cpp

index 73c0925828550f21415277fbdf0d4b1a20ecb75d..caba91961273193fab2b1ddbdb16ebb55a518f9b 100644 (file)
@@ -388,6 +388,7 @@ SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *bod
 
                 virtual switch_status_t run_dtmf_callback(void *input, switch_input_type_t itype) = 0;
 
+                SWITCH_DECLARE(void) consoleLog(char *level_str, char *msg);
         };
 
 
index ad66210c72a2540547c23ab5fdb06a01de14e566..07570262966255b5f6f92301a8e2f6d35fd47c58 100644 (file)
@@ -1221,6 +1221,18 @@ SWITCH_DECLARE(void) CoreSession::setHangupHook(void *hangup_func) {
     switch_core_event_hook_add_state_change(session, hanguphook);
 }
 
+SWITCH_DECLARE(void) CoreSession::consoleLog(char *level_str, char *msg)
+{
+       switch_log_level_t level = SWITCH_LOG_DEBUG;
+       if (level_str) {
+               level = switch_log_str2level(level_str);
+               if (level == SWITCH_LOG_INVALID) {
+                       level = SWITCH_LOG_DEBUG;
+               }
+       }
+       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), level, "%s", switch_str_nil(msg));
+}
+
 /* ---- methods not bound to CoreSession instance ---- */