Simplify syntax for negated log domains

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.
This commit is contained in:
Nick Mathewson 2011-01-25 15:03:36 -05:00
parent 23f8bedddb
commit e261a1a3e6
3 changed files with 10 additions and 3 deletions

View 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.

View 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.

View 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;