event cleanup from windows perspective

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@204 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2005-12-23 21:09:36 +00:00
parent 3643ad3037
commit f3d711ccae
13 changed files with 102 additions and 100 deletions

View File

@@ -87,19 +87,12 @@ SWITCH_DECLARE(void) switch_console_printf(switch_text_channel channel, char *fi
int ret = 0;
va_list ap;
FILE *handle;
char *filep = file, *p;
char *filep = switch_cut_path(file);
va_start(ap, fmt);
handle = switch_core_data_channel(channel);
while((p = strchr(filep, '/'))) {
filep = p + 1;
}
while((p = strchr(filep, '\\'))) {
filep = p + 1;
}
#ifdef HAVE_VASPRINTF
ret = vasprintf(&data, fmt, ap);
#else
@@ -129,10 +122,10 @@ SWITCH_DECLARE(void) switch_console_printf(switch_text_channel channel, char *fi
switch_event_running() == SWITCH_STATUS_SUCCESS &&
switch_event_create(&event, SWITCH_EVENT_LOG) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, "log_data", "%s", data);
switch_event_add_header(event, "log_file", "%s", filep);
switch_event_add_header(event, "log_function", "%s", func);
switch_event_add_header(event, "log_line", "%d", line);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Data", "%s", data);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-File", "%s", filep);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Function", "%s", func);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Line", "%d", line);
switch_event_fire(&event);
}
free(data);