|Re: A logger directly in *.eiq possible? [message #1317737 is a reply to message #1317052]
||Sun, 27 April 2014 07:53
| Abel Hegedus
Registered: September 2015
You could use Logger calls in check expressions, but please don't! While it is true that it would be called every time the given check expression is evaluated, you would have to clutter your pattern definitions with accessing the attributes needed for logging (e.g. name feature of your parameters), which would in turn modify the meaning of your pattern as well.|
Additionally, your patterns are never _called_ during runtime. A Rete network of nodes are built which propagate updates based on model changes. The check expression would be just another node that is called at some point when something related to the check expression changes.
The API (both generic and generated) was designed in order to provide such functionality from code, instead of messing with your declarative pattern definitions.
There are several possibilities:
- If you want to see which patterns are initialized by the engine, you can set the logging level of the IncQueryEngine to TRACE and look for the pattern builder logging events. See https://wiki.eclipse.org/EMFIncQuery/UserDocumentation/API/Advanced#Logging_in_EMF-IncQuery for details on how to turn on global logging.
- If you want to get notifications on match set changes on each matcher in an engine, you can attach a life-cycle listener to the engine (which will notify you of matcher initialization) and match update listeners on each matcher in the engine. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=398744
- If you need this functionality in the Query Explorer, you can contribute to the menu (similarly to the Show location and (Re)Initialize Viewers Sandbox items).
Finally, you could create a Bugzilla for the following:
- add logger level setting preferences option for Query Explorer
- add trace level log events for match set changes using a well-defined Logger (e.g. IncQueryLoggingUtil.getLogger(BaseMatcher.class))
Powered by FUDForum
. Page generated in 0.03095 seconds