[asterisk-commits] russell: trunk r38439 - in /trunk: ./ doc/ include/asterisk/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jul 28 12:17:56 MST 2006


Author: russell
Date: Fri Jul 28 14:17:56 2006
New Revision: 38439

URL: http://svn.digium.com/view/asterisk?rev=38439&view=rev
Log:
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

Modified:
    trunk/asterisk.c
    trunk/doc/asterisk-conf.txt
    trunk/include/asterisk/options.h
    trunk/logger.c

Modified: trunk/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/asterisk.c?rev=38439&r1=38438&r2=38439&view=diff
==============================================================================
--- trunk/asterisk.c (original)
+++ trunk/asterisk.c Fri Jul 28 14:17:56 2006
@@ -2215,7 +2215,7 @@
 		/* verbose level (-v at startup) */
 		if (!strcasecmp(v->name, "verbose")) {
 			option_verbose = atoi(v->value);
-		/* whether or not to force timestamping. (-T at startup) */
+		/* whether or not to force timestamping in CLI verbose output. (-T at startup) */
 		} else if (!strcasecmp(v->name, "timestamp")) {
 			ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_TIMESTAMP);
 		/* whether or not to support #exec in config files */

Modified: trunk/doc/asterisk-conf.txt
URL: http://svn.digium.com/view/asterisk/trunk/doc/asterisk-conf.txt?rev=38439&r1=38438&r2=38439&view=diff
==============================================================================
--- trunk/doc/asterisk-conf.txt (original)
+++ trunk/doc/asterisk-conf.txt Fri Jul 28 14:17:56 2006
@@ -49,7 +49,7 @@
 nocolor = yes | no				; Disable ANSI colors (-n)
 dumpcore = yes | no				; Dump core on failure (-g)
 quiet = yes | no				; Run quietly (-q)
-timestamp = yes | no				; Force timestamping on log entries to console (-T)
+timestamp = yes | no				; Force timestamping in CLI verbose output (-T)
 runuser = asterisk				; User to run asterisk as (-U) NOTE: will require changes to
 						; directory and device permisions
 rungroup = asterisk				; Group to run asterisk as (-G)

Modified: trunk/include/asterisk/options.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/options.h?rev=38439&r1=38438&r2=38439&view=diff
==============================================================================
--- trunk/include/asterisk/options.h (original)
+++ trunk/include/asterisk/options.h Fri Jul 28 14:17:56 2006
@@ -60,7 +60,7 @@
 	AST_OPT_FLAG_DUMP_CORE = (1 << 12),
 	/*! Cache sound files */
 	AST_OPT_FLAG_CACHE_RECORD_FILES = (1 << 13),
-	/*! Display timestamp in log messages */
+	/*! Display timestamp in CLI verbose output */
 	AST_OPT_FLAG_TIMESTAMP = (1 << 14),
 	/*! Override config */
 	AST_OPT_FLAG_OVERRIDE_CONFIG = (1 << 15),

Modified: trunk/logger.c
URL: http://svn.digium.com/view/asterisk/trunk/logger.c?rev=38439&r1=38438&r2=38439&view=diff
==============================================================================
--- trunk/logger.c (original)
+++ trunk/logger.c Fri Jul 28 14:17:56 2006
@@ -746,7 +746,7 @@
 
 				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 @@
 			/* 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 @@
 		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



More information about the asterisk-commits mailing list