diff options
author | Peter Palfrader <peter@palfrader.org> | 2008-03-27 17:25:49 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2008-03-27 17:25:49 +0000 |
commit | 9d132fbde6e776f2c4f18772deffa2a90faa7975 (patch) | |
tree | c7e07da3cbe92da81145ff482435238ee3b99ae0 /src/or/main.c | |
parent | 3bc512cfe2ad26870407d1365028aa5d1c40a73a (diff) | |
download | tor-9d132fbde6e776f2c4f18772deffa2a90faa7975.tar.gz tor-9d132fbde6e776f2c4f18772deffa2a90faa7975.zip |
Add --hush switch.
New --hush command-line option similar to --quiet. While --quiet disables all
logging to the console on startup, --hush limits the output to messages of
warning and error severity.
svn:r14222
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c index 9f6bff67f6..4ff46461ff 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1780,12 +1780,21 @@ tor_init(int argc, char *argv[]) /* We search for the "quiet" option first, since it decides whether we * will log anything at all to the command line. */ for (i=1;i<argc;++i) { - if (!strcmp(argv[i], "--quiet")) + if (!strcmp(argv[i], "--hush")) quiet = 1; + if (!strcmp(argv[i], "--quiet")) + quiet = 2; } - if (!quiet) { - /* give it somewhere to log to initially */ - add_temp_log(); + /* give it somewhere to log to initially */ + switch (quiet) { + case 2: + /* no initial logging */ + break; + case 1: + add_temp_log(LOG_WARN); + break; + default: + add_temp_log(LOG_NOTICE); } log(LOG_NOTICE, LD_GENERAL, "Tor v%s. This is experimental software. " |