aboutsummaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-09-29 18:13:37 +0000
committerNick Mathewson <nickm@torproject.org>2006-09-29 18:13:37 +0000
commit87648bdcf8a32e620c6f669fa479802a6e48a0e8 (patch)
tree32ba7e53cec33ce9db46dd2c2c9e7e6f9cbfc75a /src/common/log.c
parentb21e656eaf8acff1e68a8b13cdbe6e06f463eff5 (diff)
downloadtor-87648bdcf8a32e620c6f669fa479802a6e48a0e8.tar.gz
tor-87648bdcf8a32e620c6f669fa479802a6e48a0e8.zip
r9008@Kushana: nickm | 2006-09-29 13:50:10 -0400
Doxygen comments for code in common. Also simplify a few code paths to be more clear/speedy/correct. svn:r8536
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/common/log.c b/src/common/log.c
index d6c5699f24..945d45e9d4 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -60,8 +60,7 @@ sev_to_string(int severity)
}
}
-/** Helper: decide whether to include the function name in the log message.
- * */
+/** Helper: decide whether to include the function name in the log message. */
static INLINE int
should_log_function_name(uint32_t domain, int severity)
{
@@ -434,6 +433,8 @@ add_callback_log(int loglevelMin, int loglevelMax, log_callback cb)
return 0;
}
+/** Adjust the configured severity of any logs whose callback function is
+ * <b>cb</b>. */
void
change_callback_log_severity(int loglevelMin, int loglevelMax,
log_callback cb)
@@ -577,7 +578,10 @@ switch_logs_debug(void)
}
#ifdef HAVE_EVENT_SET_LOG_CALLBACK
+/** A string which, if it appears in a libevent log, should be ignored. */
static const char *suppress_msg = NULL;
+/** Callback function passed to event_set_log() so we can intercept
+ * log messages from libevent. */
static void
libevent_logging_callback(int severity, const char *msg)
{
@@ -608,11 +612,13 @@ libevent_logging_callback(int severity, const char *msg)
break;
}
}
+/** Set hook to intercept log messages from libevent. */
void
configure_libevent_logging(void)
{
event_set_log_callback(libevent_logging_callback);
}
+/** Ignore any libevent log message that contains <b>msg</b> */
void
suppress_libevent_log_msg(const char *msg)
{