This repository was archived by the owner on Feb 7, 2020. It is now read-only.
Improved event tracking #67
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an implementation of @irina060981 suggestion: alpheios-project/components#308 (comment)
We already have a
PsEventData
object that contains a caller's class name. So the only addition required is the name of the caller function. I added this as a second argument to thepub()
method. That's optional and can be omitted. This way we can use without the second argument it if a caller name tracking is not required and for compatibility with the existing code.PsEventData
object is passed to the callback function as a second argument, right afterdata
. That would allow to use it as an optional arguments: callbacks that do not need this info can ignore it, others can use it.I've also added a
description
getter that outputs event tracking information in a "human-readable form" of:LexicalQuery.finalize -> [Lexical Query Complete]
(what was the caller and what was an event name)
Please let me know what do you think. Just want to offer this for discussion. I thought it would be easier to submit a PR than to describe everything in an issue. Thanks!
P.S. For alpheios-project/components#308