SpineEventEngine/logging

Introduce a back-end "plugin" supplied with the context of ongoing domain signal dispatching

Opened this issue · 0 comments

Currently, Spine provides a number of system events, emitted before and after signal dispatching. Eventually, these system events are transformed into traces (and then are fed to some tracing system, such as Google Trace API).

However, it is now impossible to track (and associate with those system events) any calls to logging, made from within the signal handler.

In scope of this task, it would be nice to achieve the following:

  1. Allow to register a "plugin" into Spine logging back-end, which, at runtime, would be supplied with the context of currently dispatched signal (i.e. Entity type, Entity ID, signal being dispatched, etc).
  2. Process all calls made from the dispatcher code to Spine's logger, and allow end-users to enrich their logging statements with the information from the dispatching context. In other words, end-users will be able to write their code for this custom logging "plugin", which would be called when, at runtime, someone logs something during the signal dispatching.
  3. Also, it would be nice to emit system events, that correspond to log statements made. In this way, Spine's tracing sub-system will have a full picture: from the beginning of signal handling, through the details (log statements), down to the dispatch outcome.