From 84933f21841e667d4f4fa5d629ecbae303e8c26a Mon Sep 17 00:00:00 2001 From: tilghman Date: Wed, 24 Feb 2010 21:02:18 +0000 Subject: Remove color code sequences from verbose messages that go to logfiles. (closes issue #16786) Reported by: dodo Patches: logger2.patch uploaded by dodo (license 989) Tested by: tilghman git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@248582 f38db490-d61c-443f-a65b-d21fe96a405b --- main/logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/logger.c b/main/logger.c index e1913eed3..99ab0b288 100644 --- a/main/logger.c +++ b/main/logger.c @@ -785,7 +785,7 @@ void ast_log(int level, const char *file, int line, const char *function, const ast_dynamic_str_thread_set(&buf, BUFSIZ, &log_buf, "[%s] %s[%ld] %s: ", date, levels[level], (long)GETTID(), file); - res = fprintf(chan->fileptr, "%s", buf->str); + res = fprintf(chan->fileptr, "%s", term_strip(buf->str, buf->str, strlen(buf->str) + 1)); if (res <= 0 && !ast_strlen_zero(buf->str)) { /* Error, no characters printed */ fprintf(stderr,"**** Asterisk Logging Error: ***********\n"); if (errno == ENOMEM || errno == ENOSPC) { -- cgit v1.2.3