[asterisk-commits] russell: branch
russell/ast_verbose_threadstorage r38402 - /team/russell/ast_...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Jul 27 21:23:19 MST 2006
Author: russell
Date: Thu Jul 27 23:23:19 2006
New Revision: 38402
URL: http://svn.digium.com/view/asterisk?rev=38402&view=rev
Log:
changed my mind about removing this code ...
Modified:
team/russell/ast_verbose_threadstorage/asterisk.c
Modified: team/russell/ast_verbose_threadstorage/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_verbose_threadstorage/asterisk.c?rev=38402&r1=38401&r2=38402&view=diff
==============================================================================
--- team/russell/ast_verbose_threadstorage/asterisk.c (original)
+++ team/russell/ast_verbose_threadstorage/asterisk.c Thu Jul 27 23:23:19 2006
@@ -1178,9 +1178,31 @@
quit_handler(num, 0, 1, 0);
}
+static const char *fix_header(char *outbuf, int maxout, const char *s, char *cmp)
+{
+ const char *c;
+ if (!strncmp(s, cmp, strlen(cmp))) {
+ c = s + strlen(cmp);
+ term_color(outbuf, cmp, COLOR_GRAY, 0, maxout);
+ return c;
+ }
+ return NULL;
+}
+
static void console_verboser(const char *s)
{
- fputs(s, stdout);
+ char tmp[80];
+ const char *c = NULL;
+
+ if ((c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_4)) ||
+ (c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_3)) ||
+ (c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_2)) ||
+ (c = fix_header(tmp, sizeof(tmp), s, VERBOSE_PREFIX_1))) {
+ fputs(tmp, stdout);
+ fputs(c, stdout);
+ } else
+ fputs(s, stdout);
+
fflush(stdout);
/* Wake up a poll()ing console */
More information about the asterisk-commits
mailing list