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:

committed by
Julian Bouzas

parent
a6b3f1c1fb
commit
ff833b138d
@@ -62,6 +62,7 @@ end
|
||||
AsyncEventHook {
|
||||
priority = 10,
|
||||
type = "on-event",
|
||||
name = "create-item-node-added",
|
||||
interests = {
|
||||
EventInterest {
|
||||
Constraint { "event.type", "=", "object-added" },
|
||||
@@ -139,6 +140,7 @@ AsyncEventHook {
|
||||
SimpleEventHook {
|
||||
priority = 10,
|
||||
type = "on-event",
|
||||
name = "create-item-node-removed",
|
||||
interests = {
|
||||
EventInterest {
|
||||
Constraint { "event.type", "=", "object-removed" },
|
||||
|
Reference in New Issue
Block a user