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.
If need to insert new rule in the middle, need to remove all following rules?