summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-03-30 03:15:53 +0000
committerRoger Dingledine <arma@torproject.org>2004-03-30 03:15:53 +0000
commit524312494b5c5b015dd7f0db350c959afdefcf9a (patch)
tree76569f547149d62f320ffc90168f45985ea5b7b7
parent0864d3f484f20fa5f2657a339dcb2e166bfa1a0f (diff)
downloadtor-524312494b5c5b015dd7f0db350c959afdefcf9a.tar.gz
tor-524312494b5c5b015dd7f0db350c959afdefcf9a.zip
use 'notice' loglevel for things the operator should hear
but that aren't warnings svn:r1384
-rw-r--r--src/or/circuit.c2
-rw-r--r--src/or/config.c9
-rw-r--r--src/or/main.c6
3 files changed, 9 insertions, 8 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c
index 80b38dba23..6df8bc9a94 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -1256,7 +1256,7 @@ int circuit_finish_handshake(circuit_t *circ, char *reply) {
log_fn(LOG_INFO,"finished");
if(!has_completed_circuit) {
has_completed_circuit=1;
- log_fn(LOG_WARN,"Tor has successfully opened a circuit. Looks like it's working.");
+ log_fn(LOG_NOTICE,"Tor has successfully opened a circuit. Looks like it's working.");
}
circuit_log_path(LOG_INFO,circ);
circuit_rep_hist_note_result(circ);
diff --git a/src/or/config.c b/src/or/config.c
index 4bec39d043..d23453c6f6 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -419,7 +419,7 @@ static void free_options(or_options_t *options) {
static void init_options(or_options_t *options) {
/* give reasonable values for each option. Defaults to zero. */
memset(options,0,sizeof(or_options_t));
- options->LogLevel = tor_strdup("warn");
+ options->LogLevel = tor_strdup("notice");
options->ExitNodes = tor_strdup("");
options->EntryNodes = tor_strdup("");
options->ExcludeNodes = tor_strdup("");
@@ -501,8 +501,7 @@ int getconfig(int argc, char **argv, or_options_t *options) {
cf = config_open(fname);
if(!cf) {
if(using_default_torrc == 1) {
- log(LOG_WARN, "Configuration file '%s' not found, using defaults (this is fine).",fname);
- /* XXX change this WARN to INFO once we start using this feature */
+ log(LOG_NOTICE, "Configuration file '%s' not present, using reasonable defaults.",fname);
if(config_assign_default(options) < 0)
return -1;
} else {
@@ -549,12 +548,14 @@ int getconfig(int argc, char **argv, or_options_t *options) {
options->loglevel = LOG_ERR;
else if(!strcmp(options->LogLevel,"warn"))
options->loglevel = LOG_WARN;
+ else if(!strcmp(options->LogLevel,"notice"))
+ options->loglevel = LOG_NOTICE;
else if(!strcmp(options->LogLevel,"info"))
options->loglevel = LOG_INFO;
else if(!strcmp(options->LogLevel,"debug"))
options->loglevel = LOG_DEBUG;
else {
- log(LOG_WARN,"LogLevel must be one of err|warn|info|debug.");
+ log(LOG_WARN,"LogLevel must be one of err|warn|notice|info|debug.");
result = -1;
}
}
diff --git a/src/or/main.c b/src/or/main.c
index 3478008dbd..0f0b40fc8d 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -472,7 +472,7 @@ static int init_from_config(int argc, char **argv) {
add_stream_log(options.loglevel, "<stderr>", stderr);
log_fn(LOG_WARN, "Cannot write to LogFile '%s': %s.", options.LogFile, strerror(errno));
}
- log_fn(LOG_WARN, "Successfully opened LogFile '%s', redirecting output.",
+ log_fn(LOG_NOTICE, "Successfully opened LogFile '%s', redirecting output.",
options.LogFile);
}
if(options.DebugLogFile) {
@@ -499,7 +499,7 @@ static int init_from_config(int argc, char **argv) {
static int do_hup(void) {
char keydir[512];
- log_fn(LOG_WARN,"Received sighup. Reloading config.");
+ log_fn(LOG_NOTICE,"Received sighup. Reloading config.");
has_completed_circuit=0;
/* first, reload config variables, in case they've changed */
/* no need to provide argc/v, they've been cached inside init_from_config */
@@ -730,7 +730,7 @@ int tor_main(int argc, char *argv[]) {
/* give it somewhere to log to initially */
add_stream_log(LOG_INFO, "<stdout>", stdout);
- log_fn(LOG_WARN,"Tor v%s. This is experimental software. Do not use it if you need anonymity.",VERSION);
+ log_fn(LOG_NOTICE,"Tor v%s. This is experimental software. Do not use it if you need anonymity.",VERSION);
if (network_init()<0) {
log_fn(LOG_ERR,"Error initializing network; exiting.");