log: add support for enabling/disabling logging for specific windows

By default, everything is logged. Negation (!) and wildcards (*) are
supported for matching rules. More specific/longer matching rules win
over more generic/shorter matching rules.

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.
Very confusing logic :(
If I want to have a rule to weight twice more, I need to repeat it twice? Wait, no, it will be stored only once...
Can it be just from left to right, and the first matching rule either accepts or rejects?