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
This commit is contained in:
Peter Palfrader
2008-03-27 17:25:49 +00:00
parent 3bc512cfe2
commit 9d132fbde6
5 changed files with 21 additions and 8 deletions
+2 -1
View File
@@ -1343,7 +1343,8 @@ config_get_commandlines(int argc, char **argv, config_line_t **result)
} else if (!strcmp(argv[i],"--list-fingerprint") ||
!strcmp(argv[i],"--verify-config") ||
!strcmp(argv[i],"--ignore-missing-torrc") ||
!strcmp(argv[i],"--quiet")) {
!strcmp(argv[i],"--quiet") ||
!strcmp(argv[i],"--hush")) {
i += 1; /* command-line option. ignore it. */
continue;
} else if (!strcmp(argv[i],"--nt-service") ||
+13 -4
View File
@@ -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. "