diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-08-31 12:51:22 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-08-31 12:51:22 -0400 |
commit | f74916a98f97c7e80e46400e921d54466285d1fb (patch) | |
tree | dc1859cd46e31bdc36289f6b7a0f2207e90d6d2e /src/common/log.c | |
parent | 1f7dc823c5077101e4b0760ded1d7259d57d7506 (diff) | |
download | tor-f74916a98f97c7e80e46400e921d54466285d1fb.tar.gz tor-f74916a98f97c7e80e46400e921d54466285d1fb.zip |
setup_capture_of_logs: no longer suppress log messages
Previously setup_capture_of_logs would prevent log messages from
going to the console entirely. That's a problem, since sometimes
log messages are bugs! Now setup_capture_of_logs() acts sensibly.
If you really do need to keep a message from going to the console
entirely, there is setup_full_capture_of_logs(). But only use that
if you're prepared to make sure that there are no extraneous
messages generated at all.
Diffstat (limited to 'src/common/log.c')
-rw-r--r-- | src/common/log.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/log.c b/src/common/log.c index cb62a37e52..71b67906b7 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -534,6 +534,11 @@ tor_log(int severity, log_domain_mask_t domain, const char *format, ...) if (severity > log_global_min_severity_) return; va_start(ap,format); +#ifdef TOR_UNIT_TESTS + if (domain & LD_NO_MOCK) + logv__real(severity, domain, NULL, NULL, format, ap); + else +#endif logv(severity, domain, NULL, NULL, format, ap); va_end(ap); } |