summaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-04-01 07:05:21 +0000
committerNick Mathewson <nickm@torproject.org>2005-04-01 07:05:21 +0000
commit410ecfcc712a7be76a859504f60c32441fac3a5a (patch)
treeaa89d341e4326f600e054206f9d1bb6a8f268fc5 /src/common/log.c
parentbc668233adc3e1d09b5ddd20f9ec08761ca8cb49 (diff)
downloadtor-410ecfcc712a7be76a859504f60c32441fac3a5a.tar.gz
tor-410ecfcc712a7be76a859504f60c32441fac3a5a.zip
Add code to suppress spurious libevent log msgs; use it to resolve bug 68.
svn:r3948
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 94a683fb96..6b1a1a5c03 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -482,8 +482,11 @@ void switch_logs_debug(void)
}
#ifdef HAVE_EVENT_SET_LOG_CALLBACK
+static const char *suppress_msg = NULL;
void libevent_logging_callback(int severity, const char *msg)
{
+ if (suppress_msg && strstr(msg, suppress_msg))
+ return;
switch (severity) {
case _EVENT_LOG_DEBUG:
log(LOG_DEBUG, "Message from libevent: %s", msg);
@@ -506,6 +509,10 @@ void configure_libevent_logging(void)
{
event_set_log_callback(libevent_logging_callback);
}
+void suppress_libevent_log_msg(const char *msg)
+{
+ suppress_msg = msg;
+}
#else
void configure_libevent_logging(void) {}
#endif