diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-05 22:50:31 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-05 22:50:31 +0000 |
commit | fe008cd88e22fee07510e5451a601eb4ac1e56a7 (patch) | |
tree | 8d3f9ea43cf18139139fc7bc1533511db279edf5 /main/logger.c | |
parent | 196c4e1c619d144790cec4a7257a7b2aab126575 (diff) |
Separate verbose output from CLI output, by using a preamble.
(closes issue #12402)
Reported by: Corydon76
Patches:
20080410__no_verbose_in_rx_output.diff.txt uploaded by Corydon76 (license 14)
20080501__no_verbose_in_rx_output__1.4.diff.txt uploaded by Corydon76 (license 14)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115333 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/logger.c')
-rw-r--r-- | main/logger.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/logger.c b/main/logger.c index 79ff8deaf..8f6ebaf80 100644 --- a/main/logger.c +++ b/main/logger.c @@ -875,8 +875,12 @@ void ast_verbose(const char *fmt, ...) ast_localtime(&t, &tm, NULL); strftime(date, sizeof(date), dateformat, &tm); datefmt = alloca(strlen(date) + 3 + strlen(fmt) + 1); - sprintf(datefmt, "[%s] %s", date, fmt); + sprintf(datefmt, "%c[%s] %s", 127, date, fmt); fmt = datefmt; + } else { + char *tmp = alloca(strlen(fmt) + 2); + sprintf(tmp, "%c%s", 127, fmt); + fmt = tmp; } if (!(buf = ast_dynamic_str_thread_get(&verbose_buf, VERBOSE_BUF_INIT_SIZE))) @@ -897,7 +901,7 @@ void ast_verbose(const char *fmt, ...) v->verboser(buf->str); AST_LIST_UNLOCK(&verbosers); - ast_log(LOG_VERBOSE, "%s", buf->str); + ast_log(LOG_VERBOSE, "%s", buf->str + 1); } int ast_register_verbose(void (*v)(const char *string)) |