]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Simplify syntax for negated log domains
authorNick Mathewson <nickm@torproject.org>
Tue, 25 Jan 2011 20:03:36 +0000 (15:03 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 25 Jan 2011 20:03:36 +0000 (15:03 -0500)
Previously if you wanted to say "All messages except network
messages", you needed to say "[*,~net]" and if you said "[~net]" by
mistake, you would get no messages at all.  Now, if you say "[~net]",
you get everything except networking messages.

changes/log_domains
doc/tor.1.txt
src/common/log.c

index f4cfe6f4d25fc93a5a607a5b8967375e52135874..939b9a9e74cbdc5d08b8fb84c9675165a6e7bd5d 100644 (file)
@@ -1,5 +1,9 @@
-  o Documentation
+  o Minor features
+    - Make it simpler to specify "All log domains except for A and B".
+      Previously you needed to say "[*,~A,~B]".  Now you can just say
+      "[~A,~B]".
 
+  o Documentation
     - Add documentation for configuring logging at different severities in
       different log domains.  We've had this feature since 0.2.1.1-alpha, but
       for some reason it never made it into the manpage.  Fixes bug 2215.
index 9a7ee07e70dc1193a7089c5bf57986423d5397bd..17cdf37ac041272c7f23139555d5f394168b1689 100644 (file)
@@ -341,7 +341,7 @@ Other options can be specified either on the command-line (--option
     protocol, mm, http, app, control, circ, rend, bug, dir, dirserv, or, edge,
     acct, hist, and handshake.  Domain names are case-insensitive. +
  +
-    For example, "`Log [handshake]debug [*,~net,~mm]info notice stdout`" sends
+    For example, "`Log [handshake]debug [~net,~mm]info notice stdout`" sends
     to stdout: all handshake messages of any severity, all info-and-higher
     messages from domains other than networking and memory management, and all
     messages of severity notice or higher.
index 2fef2cc5d9a06cccb55f65638edd7ac9ba6210ba..28fca4eaca1ad0531eedf956a51150962b8c5a7a 100644 (file)
@@ -919,7 +919,10 @@ parse_log_severity_config(const char **cfg_ptr,
       smartlist_free(domains_list);
       if (err)
         return -1;
-      domains &= ~neg_domains;
+      if (domains == 0 && neg_domains)
+        domains = ~neg_domains;
+      else
+        domains &= ~neg_domains;
       cfg = eat_whitespace(closebracket+1);
     } else {
       ++got_an_unqualified_range;