From: Tilghman Lesher Date: Wed, 24 Feb 2010 21:02:18 +0000 (+0000) Subject: Remove color code sequences from verbose messages that go to logfiles. X-Git-Tag: 1.4.30-rc3~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=252704411cb6532cb554fa43615d4c270ec6aa49;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@248582 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/logger.c b/main/logger.c index e1913eed30..99ab0b288b 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) {