event-dispatcher: log event and hook names and chains

- Add a new variable "name" in WpEventHook and use it to log all the
  hooks(by name) picked up in _push_event(). This gives a clear picture
  if hook is registered for a given event.
- Form a name for an event and a chain of events for an event run, log
  both of them. This gives a clear picture of the events executed and
  order in which they are dispatched.
- Similarly build hooks chain and print it in _source_dispatch(), this
  gives a clear picture of the hooks picked and the order in which they
  are dispatched.
- Log only the dispatchable(with hooks) events, this de-clutters
  the log messages.
This commit is contained in:
Ashok Sidipotu
2022-06-30 10:03:18 +05:30
committed by Julian Bouzas
parent a6b3f1c1fb
commit ff833b138d
11 changed files with 192 additions and 67 deletions

View File

@@ -173,7 +173,8 @@ wp_default_nodes_api_enable (WpPlugin * plugin, WpTransition * transition)
g_return_if_fail (dispatcher);
/* default metadata added */
hook = wp_simple_event_hook_new (10, WP_EVENT_HOOK_EXEC_TYPE_ON_EVENT,
hook = wp_simple_event_hook_new ("default-nodes-api-on-metadata-added", 10,
WP_EVENT_HOOK_EXEC_TYPE_ON_EVENT,
g_cclosure_new ((GCallback) on_metadata_added, self, NULL));
wp_interest_event_hook_add_interest (WP_INTEREST_EVENT_HOOK (hook),
WP_CONSTRAINT_TYPE_PW_PROPERTY, "event.type", "=s", "object-added",
@@ -184,7 +185,8 @@ wp_default_nodes_api_enable (WpPlugin * plugin, WpTransition * transition)
g_clear_object(&hook);
/* default metadata changed */
hook = wp_simple_event_hook_new (10, WP_EVENT_HOOK_EXEC_TYPE_ON_EVENT,
hook = wp_simple_event_hook_new ("default-nodes-api-on-metadata-changed", 10,
WP_EVENT_HOOK_EXEC_TYPE_ON_EVENT,
g_cclosure_new ((GCallback) on_metadata_changed_hook, self, NULL));
wp_interest_event_hook_add_interest (WP_INTEREST_EVENT_HOOK (hook),
WP_CONSTRAINT_TYPE_PW_PROPERTY, "event.type", "=s", "object-changed",