[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Revise control spec and implementation to allow all log mes...



Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv11142/src/common

Modified Files:
	log.c log.h 
Log Message:
Revise control spec and implementation to allow all log messages to be sent to controller with their severities intact.

Index: log.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/log.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- log.c	1 Apr 2005 20:15:54 -0000	1.91
+++ log.c	5 Apr 2005 22:56:16 -0000	1.92
@@ -373,6 +373,18 @@
   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)
 {

Index: log.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/log.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- log.h	1 Apr 2005 20:15:54 -0000	1.43
+++ log.h	5 Apr 2005 22:56:16 -0000	1.44
@@ -69,6 +69,8 @@
 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);