Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327757 - QVTo log writer gets strings instead of objects, making custom loggers useless/impossible
Summary: QVTo log writer gets strings instead of objects, making custom loggers useles...
Status: RESOLVED FIXED
Alias: None
Product: QVTo
Classification: Modeling
Component: Engine (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Sergey Boyko CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-14 07:13 EDT by Sergey Boyko CLA
Modified: 2011-03-15 17:11 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Boyko CLA 2010-10-14 07:13:05 EDT
QVTo has a org.eclipse.m2m.qvt.oml.util.WriterLog class that implements org.eclipse.m2m.qvt.oml.util.Log. There is a:

    void log(String message, Object param);

method in the interface. If I do this in QVTo:

    log("some message", someObj);

I would expect that 'param' in the log method of the Log interface, would get the value of the object I provided (someObj in this case).

However, the doVisitLogExp method of the org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl class (which calls the log method of the logger), uses the EvaluationUtil.formatLoggedElement method to convert the object to a string representation, before passing it along to the log method of the logger.

This means that the log method of the logger (like the WriterLog class), always get strings instead of the objects. This also means I can't do anything custom to create different string representations for the objects being logged. That is, not without changing QVTo itself.

Resolution: Behavior should be changed, so that the object itself is passed to the logger.
Comment 1 Dennis Hendriks CLA 2010-10-14 07:39:02 EDT
> Resolution: Behavior should be changed, so that the object itself is passed to
the logger.

Obviously, to keep the current behavior, the default logger should then do the same conversion to string...
Comment 2 Sergey Boyko CLA 2010-11-15 04:33:21 EST
Committed.
Comment 3 Dennis Hendriks CLA 2011-03-14 04:34:49 EDT
> Committed.

Since it was committed, I expected it to be in Helios SR2. However, this does not seem to be the case. Will it not be included in official releases until Indigo?
Comment 4 Sergey Boyko CLA 2011-03-15 17:11:09 EDT
(In reply to comment #3)

It was my slip. I've committed changes to HEAD only so fix is available only with Indigo Mx builds.

In case of necessity I can issue 3.0.1 maintenace build for Helios.

> 
> Since it was committed, I expected it to be in Helios SR2. However, this does
> not seem to be the case. Will it not be included in official releases until
> Indigo?