summaryrefslogtreecommitdiff
path: root/src/app/main/main.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-03-11 12:12:28 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-07-08 11:11:58 -0400
commitb049cc3ace18dd42493ca768cf4636dfd89569fc (patch)
treea70016f891b7025b497637e4bbd9df3a2dd6e6b3 /src/app/main/main.c
parent3604d86a016b6202a5864a81f46addc087658b8c (diff)
downloadtor-b049cc3ace18dd42493ca768cf4636dfd89569fc.tar.gz
tor-b049cc3ace18dd42493ca768cf4636dfd89569fc.zip
trace: Emit a warning if tracing is built in
Built in tracing should _not_ be run if it was not set on purpose. Warn as loud as we can in order to inform the user that they are running a version with tracing capabilities built in. This commit also adds a subsys stub because utlimately the logging will happen in the init phase but because the default log file is not set in the sys_logging init function, the stub is not useful for now. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/app/main/main.c')
-rw-r--r--src/app/main/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app/main/main.c b/src/app/main/main.c
index 89ba787422..e1d5772e3d 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -59,6 +59,7 @@
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_s2k.h"
#include "lib/net/resolve.h"
+#include "lib/trace/trace.h"
#include "lib/process/waitpid.h"
#include "lib/pubsub/pubsub_build.h"
@@ -602,6 +603,9 @@ tor_init(int argc, char *argv[])
rust_log_welcome_string();
#endif /* defined(HAVE_RUST) */
+ /* Warn _if_ the tracing subsystem is built in. */
+ tracing_log_warning();
+
int init_rv = options_init_from_torrc(argc,argv);
if (init_rv < 0) {
log_err(LD_CONFIG,"Reading config failed--see warnings above.");