aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-10-18 00:13:08 +0000
committerRoger Dingledine <arma@torproject.org>2003-10-18 00:13:08 +0000
commit193383b70aa1b0b33a85268196beb1cc29322850 (patch)
treec3445d49c5a2094b190bee6afeb57cfc38800971
parent82aa621b47018838c9659d34ab34cd6517815daa (diff)
downloadtor-193383b70aa1b0b33a85268196beb1cc29322850.tar
tor-193383b70aa1b0b33a85268196beb1cc29322850.tar.gz
log to stdout while parsing config,
otherwise we log to nothing and give no feedback! svn:r617
-rw-r--r--src/or/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c
index ffe5d00d7..dd42865c4 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -780,17 +780,21 @@ void write_pidfile(char *filename) {
int tor_main(int argc, char *argv[]) {
+ /* give it somewhere to log to initially */
+ add_stream_log(LOG_INFO, "<stdout>", stdout);
+
if(getconfig(argc,argv,&options)) {
log_fn(LOG_ERR,"Reading config file failed. exiting.");
return -1;
}
log_set_severity(options.loglevel); /* assign logging severity level from options */
+ close_logs(); /* close stdout, then open with correct loglevel if necessary */
+ if(!options.LogFile && !options.RunAsDaemon)
+ add_stream_log(options.loglevel, "<stdout>", stdout);
if(options.DebugLogFile)
add_file_log(LOG_DEBUG, options.DebugLogFile);
if(options.LogFile)
add_file_log(options.loglevel, options.LogFile);
- if(!options.LogFile && !options.RunAsDaemon)
- add_stream_log(options.loglevel, "<stdout>", stdout);
global_read_bucket = options.TotalBandwidth; /* start it at 1 second of traffic */
stats_prev_global_read_bucket = global_read_bucket;