[or-cvs] when recommending new-format log lines, if the upper bound ...

Roger Dingledine arma at seul.org
Tue Dec 7 06:27:42 UTC 2004


Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	config.c 
Log Message:
when recommending new-format log lines, if the upper bound is LOG_ERR,
leave it implicit.


Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.280
retrieving revision 1.281
diff -u -d -r1.280 -r1.281
--- config.c	4 Dec 2004 01:14:35 -0000	1.280
+++ config.c	7 Dec 2004 06:27:39 -0000	1.281
@@ -1170,7 +1170,7 @@
 
   /* Special case if no options are given. */
   if (!options->Logs) {
-    options->Logs = config_line_prepend(NULL, "Log", "notice-err stdout");
+    options->Logs = config_line_prepend(NULL, "Log", "notice stdout");
   }
 
   if (config_init_logs(options, 1)<0) /* Validate the log(s) */
@@ -1896,10 +1896,11 @@
   char buf[512];
   int n;
 
-  n = tor_snprintf(buf, sizeof(buf), "%s-%s %s%s%s",
+  n = tor_snprintf(buf, sizeof(buf), "%s%s%s %s%s%s",
                    log_level_to_string(minSeverity),
-                   log_level_to_string(maxSeverity),
-                  type, fname?" ":"", fname?fname:"");
+                   maxSeverity == LOG_ERR ? "" : "-",
+                   maxSeverity == LOG_ERR ? "" : log_level_to_string(maxSeverity),
+                   type, fname?" ":"", fname?fname:"");
   if (n<0) {
     log_fn(LOG_WARN, "Normalized log option too long.");
     return -1;



More information about the tor-commits mailing list