From cac70edab7fe9e3a0c7583de7023a3e877112020 Mon Sep 17 00:00:00 2001 From: Peter Holik Date: Wed, 6 Nov 2013 07:52:39 +0100 Subject: [PATCH] Enable debugging of chan_lcr via ast_log With this patches i see loggings in asterisk cli by enable debugging with core set debug 1 Signed-off-by: Andreas Eversberg This feature was disabled due to locking issues with older Asterisk versions. --- chan_lcr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chan_lcr.c b/chan_lcr.c index 9adaa59..a700866 100644 --- a/chan_lcr.c +++ b/chan_lcr.c @@ -238,6 +238,8 @@ void chan_lcr_log(int type, const char *file, int line, const char *function, st char ast_text[128] = "NULL"; va_list args; + if (!option_debug) return; + ast_mutex_lock(&log_lock); va_start(args,fmt); @@ -255,8 +257,8 @@ void chan_lcr_log(int type, const char *file, int line, const char *function, st #endif ast_text[sizeof(ast_text)-1] = '\0'; -// ast_log(type, file, line, function, "[call=%s ast=%s] %s", call_text, ast_text, buffer); - printf("[call=%s ast=%s line=%d] %s", call_text, ast_text, line, buffer); + ast_log(type, file, line, function, "[call=%s ast=%s] %s", call_text, ast_text, buffer); +// printf("[call=%s ast=%s line=%d] %s", call_text, ast_text, line, buffer); ast_mutex_unlock(&log_lock); } -- 2.13.6