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.
Rule is enabled, or logging is enabled?