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