]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Event filter - Support wildcards in event names
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 26 Apr 2018 18:21:40 +0000 (21:21 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 21 May 2018 09:03:11 +0000 (09:03 +0000)
This allows for example log_debug=event:*

src/lib/event-filter.c
src/lib/event-filter.h

index 23d46239f59a156b5471899ca228bf42df7171a7..6dd30c74ce8140e2ab6ddd38a8e61ee86330eda3 100644 (file)
@@ -483,7 +483,7 @@ event_filter_query_match(const struct event_filter_query_internal *query,
 
        if (query->name != NULL) {
                if (event->sending_name == NULL ||
-                   strcmp(event->sending_name, query->name) != 0)
+                   !wildcard_match(event->sending_name, query->name))
                        return FALSE;
        }
        if (query->source_filename != NULL) {
index 4191e5a70d5d22eb5cc2a69bb1afcb94e08d1ed6..c8355e619c22faa217a4b5b7f32a1b09c8ef9d50 100644 (file)
@@ -14,7 +14,7 @@ struct event_filter_query {
        /* key=NULL-terminated list of key=value fields */
        const struct event_filter_field *fields;
 
-       /* event name */
+       /* event name. Supports '*' and '?' wildcards. */
        const char *name;
        /* source filename:line */
        const char *source_filename;