[or-cvs] print an entry at the top of the logfile so you know it"s w...

Roger Dingledine arma at seul.org
Mon Jan 5 05:22:07 UTC 2004


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

Modified Files:
	main.c 
Log Message:
print an entry at the top of the logfile so you know it's working
clean up a minor bug in a debugfile log entry


Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -d -r1.161 -r1.162
--- main.c	3 Jan 2004 22:40:49 -0000	1.161
+++ main.c	5 Jan 2004 05:22:04 -0000	1.162
@@ -403,15 +403,20 @@
   close_logs(); /* we'll close, then open with correct loglevel if necessary */
   if(!options.LogFile && !options.RunAsDaemon)
     add_stream_log(options.loglevel, "<stdout>", stdout);
-  if(options.LogFile)
+  if(options.LogFile) {
     if (add_file_log(options.loglevel, options.LogFile) != 0) {
       /* opening the log file failed!  Use stderr and log a warning */
       add_stream_log(options.loglevel, "<stderr>", stderr);
       log_fn(LOG_WARN, "Cannot write to LogFile '%s': %s.", options.LogFile, strerror(errno));
     }
-  if(options.DebugLogFile)
+    log_fn(LOG_WARN, "Successfully opened LogFile '%s', redirecting output.",
+           options.LogFile);
+  }
+  if(options.DebugLogFile) {
     if (add_file_log(LOG_DEBUG, options.DebugLogFile) != 0)
-      log_fn(LOG_WARN, "Cannot write to DebugLogFile '%s': %s.", options.LogFile, strerror(errno));
+      log_fn(LOG_WARN, "Cannot write to DebugLogFile '%s': %s.", options.DebugLogFile, strerror(errno));
+    log_fn(LOG_DEBUG, "Successfully opened DebugLogFile '%s'.", options.DebugLogFile);
+  }
 
   global_read_bucket = options.TotalBandwidth; /* start it at 1 second of traffic */
   stats_prev_global_read_bucket = global_read_bucket;



More information about the tor-commits mailing list