summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-04-05 22:56:17 +0000
committerNick Mathewson <nickm@torproject.org>2005-04-05 22:56:17 +0000
commit499129093599f2395331c53fc2b911ed66b97a22 (patch)
treee855bdd2feccc22a73c9546ddd5ae855bcbd7a45 /src/common
parent46be0fa99915608d823ac6b82356f60ea7e5fc1d (diff)
downloadtor-499129093599f2395331c53fc2b911ed66b97a22.tar.gz
tor-499129093599f2395331c53fc2b911ed66b97a22.zip
Revise control spec and implementation to allow all log messages to be sent to controller with their severities intact.
svn:r4010
Diffstat (limited to 'src/common')
-rw-r--r--src/common/log.c12
-rw-r--r--src/common/log.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 863f18b69f..ce33810a63 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -373,6 +373,18 @@ int add_callback_log(int loglevelMin, int loglevelMax, log_callback cb)
return 0;
}
+void change_callback_log_severity(int loglevelMin, int loglevelMax,
+ log_callback cb)
+{
+ logfile_t *lf;
+ for (lf = logfiles; lf; lf = lf->next) {
+ if (lf->callback == cb) {
+ lf->loglevel = loglevelMin;
+ lf->max_loglevel = loglevelMax;
+ }
+ }
+}
+
/** Close any log handlers added by add_temp_log or marked by mark_logs_temp */
void close_temp_logs(void)
{
diff --git a/src/common/log.h b/src/common/log.h
index aa4d7ca91f..bfcb557e6d 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -69,6 +69,8 @@ void close_temp_logs(void);
void mark_logs_temp(void);
void configure_libevent_logging(void);
void suppress_libevent_log_msg(const char *msg);
+void change_callback_log_severity(int loglevelMin, int loglevelMax,
+ log_callback cb);
/* Outputs a message to stdout */
void _log(int severity, const char *format, ...) CHECK_PRINTF(2,3);