[Freeswitch-svn] [commit] r7656 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket
Freeswitch SVN
mikej at freeswitch.org
Sun Feb 17 01:02:45 EST 2008
Author: mikej
Date: Sun Feb 17 01:02:45 2008
New Revision: 7656
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
Log:
don't log lost logs of 0
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Sun Feb 17 01:02:45 2008
@@ -109,13 +109,15 @@
char *data = strdup(node->data);
if (data) {
if (switch_queue_trypush(l->log_queue, data) == SWITCH_STATUS_SUCCESS) {
- int ll = l->lost_logs;
- switch_event_t *event;
- l->lost_logs = 0;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Lost %d log lines!\n", ll);
- if (switch_event_create(&event, SWITCH_EVENT_TRAP) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "info", "lost %d log lines", ll);
- switch_event_fire(&event);
+ if (l->lost_logs) {
+ int ll = l->lost_logs;
+ switch_event_t *event;
+ l->lost_logs = 0;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Lost %d log lines!\n", ll);
+ if (switch_event_create(&event, SWITCH_EVENT_TRAP) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "info", "lost %d log lines", ll);
+ switch_event_fire(&event);
+ }
}
} else {
switch_safe_free(data);
More information about the Freeswitch-svn
mailing list