[svn-commits] tilghman: trunk r248584 - in /trunk: ./ include/asterisk/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Feb 24 15:17:31 CST 2010


Author: tilghman
Date: Wed Feb 24 15:17:26 2010
New Revision: 248584

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=248584
Log:
Merged revisions 248582 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248582 | tilghman | 2010-02-24 15:02:18 -0600 (Wed, 24 Feb 2010) | 7 lines
  
  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
........

Modified:
    trunk/   (props changed)
    trunk/include/asterisk/term.h
    trunk/main/logger.c
    trunk/main/term.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/include/asterisk/term.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/term.h?view=diff&rev=248584&r1=248583&r2=248584
==============================================================================
--- trunk/include/asterisk/term.h (original)
+++ trunk/include/asterisk/term.h Wed Feb 24 15:17:26 2010
@@ -92,7 +92,7 @@
  */
 char *term_color_code(char *outbuf, int fgcolor, int bgcolor, int maxout);
 
-char *term_strip(char *outbuf, char *inbuf, int maxout);
+char *term_strip(char *outbuf, const char *inbuf, int maxout);
 
 void term_filter_escapes(char *line);
 

Modified: trunk/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/logger.c?view=diff&rev=248584&r1=248583&r2=248584
==============================================================================
--- trunk/main/logger.c (original)
+++ trunk/main/logger.c Wed Feb 24 15:17:26 2010
@@ -832,12 +832,13 @@
 				int res = 0;
 
 				/* If no file pointer exists, skip it */
-				if (!chan->fileptr)
+				if (!chan->fileptr) {
 					continue;
-				
+				}
+
 				/* Print out to the file */
 				res = fprintf(chan->fileptr, "[%s] %s[%ld] %s: %s",
-					      logmsg->date, logmsg->level_name, logmsg->process_id, logmsg->file, logmsg->message);
+					      logmsg->date, logmsg->level_name, logmsg->process_id, logmsg->file, term_strip(buf, logmsg->message, BUFSIZ));
 				if (res <= 0 && !ast_strlen_zero(logmsg->message)) {
 					fprintf(stderr, "**** Asterisk Logging Error: ***********\n");
 					if (errno == ENOMEM || errno == ENOSPC)

Modified: trunk/main/term.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/term.c?view=diff&rev=248584&r1=248583&r2=248584
==============================================================================
--- trunk/main/term.c (original)
+++ trunk/main/term.c Wed Feb 24 15:17:26 2010
@@ -268,9 +268,10 @@
 	return outbuf;
 }
 
-char *term_strip(char *outbuf, char *inbuf, int maxout)
-{
-	char *outbuf_ptr = outbuf, *inbuf_ptr = inbuf;
+char *term_strip(char *outbuf, const char *inbuf, int maxout)
+{
+	char *outbuf_ptr = outbuf;
+	const char *inbuf_ptr = inbuf;
 
 	while (outbuf_ptr < outbuf + maxout) {
 		switch (*inbuf_ptr) {




More information about the svn-commits mailing list