diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-28 19:17:56 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-28 19:17:56 +0000 |
commit | a4784fa28c3b3a6bbf05746b1677151d89c60ea4 (patch) | |
tree | 6129df958890808e11243265c42daa3118c29b9e /logger.c | |
parent | e2c714c0cff1a5c76c83a9b4280d5fad6ddae714 (diff) |
As discussed and decided on the asterisk-dev mailing list ...
- Fix some breakage I introduced a while ago that made the timestamps option
not functional for CLI verbose output.
- Remove the use of the timestamps option for log output, since it was not
functional.
- clarify text referring to the timestamps option so that it is clear that it
only applies to CLI verbose output
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38439 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rw-r--r-- | logger.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -746,7 +746,7 @@ void ast_log(int level, const char *file, int line, const char *function, const if (level != __LOG_VERBOSE) { sprintf(linestr, "%d", line); - snprintf(buf, sizeof(buf), ast_opt_timestamp ? "[%s] %s[%ld]: %s:%s %s: " : "%s %s[%ld]: %s:%s %s: ", + snprintf(buf, sizeof(buf), "[%s] %s[%ld]: %s:%s %s: ", date, term_color(tmp1, levels[level], colors[level], 0, sizeof(tmp1)), (long)GETTID(), @@ -763,7 +763,7 @@ void ast_log(int level, const char *file, int line, const char *function, const /* File channels */ } else if ((chan->logmask & (1 << level)) && (chan->fileptr)) { int res; - snprintf(buf, sizeof(buf), ast_opt_timestamp ? "[%s] %s[%ld]: " : "%s %s[%ld] %s: ", date, + snprintf(buf, sizeof(buf), "[%s] %s[%ld] %s: ", date, levels[level], (long)GETTID(), file); res = fprintf(chan->fileptr, buf); if (res <= 0 && buf[0] != '\0') { /* Error, no characters printed */ @@ -862,6 +862,8 @@ void ast_verbose(const char *fmt, ...) localtime_r(&t, &tm); strftime(date, sizeof(date), dateformat, &tm); datefmt = alloca(strlen(date) + 3 + strlen(fmt) + 1); + sprintf(datefmt, "[%s] %s", date, fmt); + fmt = datefmt; } /* this lock is also protecting against multiple threads |