mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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:
+2
-1
@@ -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
@@ -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. "
|
||||
|
||||
Reference in New Issue
Block a user