Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » QVTo log writer gets strings instead of objects, making custom loggers useless/impossible
QVTo log writer gets strings instead of objects, making custom loggers useless/impossible [message #631110] Wed, 06 October 2010 08:06 Go to next message
Eclipse UserFriend
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl

Hello all,

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.QvtOperationalEva luationVisitorImpl
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.

My questions:
- Why is the object converted to string before passing it to the
logger?
- Could this behavior be changed, so that the object itself is passed
to the logger?

Best regards,
Dennis
Re: QVTo log writer gets strings instead of objects, making custom loggers useless/impossible [message #632819 is a reply to message #631110] Thu, 14 October 2010 11:16 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Dennis,

Looks like doVisitLogExp() performs excessive toString() conversion.
I've files this as a bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=327757

Regards,
Sergey

Dennis Hendriks wrote:
> Hello all,
>
> 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.QvtOperationalEva luationVisitorImpl
> 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.
>
> My questions:
> - Why is the object converted to string before passing it to the
> logger?
> - Could this behavior be changed, so that the object itself is passed
> to the logger?
>
> Best regards,
> Dennis
Re: QVTo log writer gets strings instead of objects, making custom loggers useless/impossible [message #632824 is a reply to message #632819] Thu, 14 October 2010 11:49 Go to previous message
Eclipse UserFriend
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl

OK, thanks Sergey.

Regards,
Dennis


Sergey Boyko wrote:
> Hi Dennis,
>
> Looks like doVisitLogExp() performs excessive toString() conversion.
> I've files this as a bug:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=327757
>
> Regards,
> Sergey
>
> Dennis Hendriks wrote:
>> Hello all,
>>
>> 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.QvtOperationalEva luationVisitorImpl
>> 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.
>>
>> My questions:
>> - Why is the object converted to string before passing it to the
>> logger?
>> - Could this behavior be changed, so that the object itself is passed
>> to the logger?
>>
>> Best regards,
>> Dennis
Previous Topic:[ATL] a working example of a programmatic launch
Next Topic:[ATL] Query in HOT transformation
Goto Forum:
  


Current Time: Fri Apr 26 15:40:21 GMT 2024

Powered by FUDForum. Page generated in 0.02793 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top