]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict: Add dict_created and dict_destroyed events
authorSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Sun, 8 Aug 2021 23:35:09 +0000 (00:35 +0100)
committersiavash.tavakoli <siavash.tavakoli@open-xchange.com>
Mon, 16 Aug 2021 08:58:47 +0000 (08:58 +0000)
Inherit from dict.event and emitted at dict initialization/deinit.

src/lib-dict/dict.c

index 2ee6fb512580fad6a2edc7cbced18560b8be7711..c1cd76692d856660aed8da59c6bccd03aeaa0480 100644 (file)
@@ -120,6 +120,8 @@ int dict_init(const char *uri, const struct dict_settings *set,
        i_assert(*dict_r != NULL);
        (*dict_r)->refcount++;
        (*dict_r)->event = event;
+       e_debug(event_create_passthrough(event)->set_name("dict_created")->event(),
+               "dict created (uri=%s, base_dir=%s)", uri, set->base_dir);
 
        return 0;
 }
@@ -141,6 +143,8 @@ static void dict_unref(struct dict **_dict)
        i_assert(dict->refcount > 0);
        if (--dict->refcount == 0) {
                dict->v.deinit(dict);
+               e_debug(event_create_passthrough(event)->
+                       set_name("dict_destroyed")->event(), "dict destroyed");
                event_unref(&event);
        }
 }