aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-08-04 14:23:51 -0400
committerNick Mathewson <nickm@torproject.org>2011-08-04 14:23:51 -0400
commite5e7b6d71835841f037841ea60cb4f39b554b892 (patch)
treeb1bb1388d948db1a35c78e205904d897c7e9e597 /src/or/config.c
parent6596aa022f03bad34a3ee9cbd627fefe55c01d54 (diff)
downloadtor-e5e7b6d71835841f037841ea60cb4f39b554b892.tar
tor-e5e7b6d71835841f037841ea60cb4f39b554b892.tar.gz
Make --quiet and --hush apply to default logs, not only initial logs
Fixes bug 3550; bugfix on 0.2.0.10-alpha (where --quiet was introduced).
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 088617bb4..ddce95889 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -40,6 +40,9 @@
#include "procmon.h"
+/* From main.c */
+extern int quiet_level;
+
/** Enumeration of types which option values can take */
typedef enum config_type_t {
CONFIG_TYPE_STRING = 0, /**< An arbitrary string. */
@@ -3095,8 +3098,12 @@ options_validate(or_options_t *old_options, or_options_t *options,
"misconfigured or something else goes wrong.");
/* Special case on first boot if no Log options are given. */
- if (!options->Logs && !options->RunAsDaemon && !from_setconf)
- config_line_append(&options->Logs, "Log", "notice stdout");
+ if (!options->Logs && !options->RunAsDaemon && !from_setconf) {
+ if (quiet_level == 0)
+ config_line_append(&options->Logs, "Log", "notice stdout");
+ else if (quiet_level == 1)
+ config_line_append(&options->Logs, "Log", "warn stdout");
+ }
if (options_init_logs(options, 1)<0) /* Validate the log(s) */
REJECT("Failed to validate Log options. See logs for details.");