log: add support for logging rules

By default, everything is logged. The first matching rule wins.
Negation (!) and wildcards (*) are supported.

For example, disable logging for all channels, except #znc:

    /msg *log add #znc !#*

Queries do not match either of the above rules, so they get logged.
Rewriting the ruleset with just new ruleset (one line) will be easier...