Skip to main content



      Home
Home » Modeling » Model-to-Model Transformation » qvto log() messages in java
qvto log() messages in java [message #1022685] Fri, 22 March 2013 06:57 Go to next message
Eclipse UserFriend
Hi,

is there any way to display the log messages created with qvto's log() function in the eclipse console when calling the QVTO transformation from within an java class?

Thank you,

Miriam
Re: qvto log() messages in java [message #1022827 is a reply to message #1022685] Fri, 22 March 2013 11:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi

All the logging occurs to a org.eclipse.m2m.qvt.oml.util.Log, so make
sure you configure an appropiate logger for your purposes.

Regards

Ed Willink


On 22/03/2013 10:57, Miriam Hundemer wrote:
> Hi,
>
> is there any way to display the log messages created with qvto's log()
> function in the eclipse console when calling the QVTO transformation
> from within an java class?
>
> Thank you,
>
> Miriam
Re: qvto log() messages in java [message #1022854 is a reply to message #1022827] Fri, 22 March 2013 12:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi Miriam;

I've implemented this feature by setting the OutputStream of the console as the log of the execution context.

To do this, you have to obtain the console window of Eclipse. The details are described here: http://wiki.eclipse.org/FAQ_How_do_I_write_to_the_console_from_a_plug-in%3F

The MessageConsoleStream obtained from the console should be used to create a WriterLog (org.eclipse.m2m.qvt.oml.util.WriterLog). For instance:

Log log = new WriterLog(new OutputStreamWriter(output));

The log is an "org.eclipse.m2m.qvt.oml.util.Log", as Ed pointed out. Then it can be when setting the executing environment details (look for the code section "setup the execution environment details" in http://wiki.eclipse.org/QVTOML/Examples/InvokeInJava). The log can be used simply as:

context.setLog(log);

Hope I haven't forgot any details Wink

Regards;
Re: qvto log() messages in java [message #1023957 is a reply to message #1022854] Mon, 25 March 2013 10:44 Go to previous message
Eclipse UserFriend
Hi,

thanks for your answers and sorry for the newbie question. Once you know how things are supposed to be done they are not quite so complicated than they appear to be at first.
I solved the problem now by simply defining a Logger for my Execution just as Ed suggested.

OutputStreamWriter outStream = new OutputStreamWriter(System.out);
Log log = new WriterLog(outStream);


And then using the log:

context.setLog(log);


Just like that Razz
Previous Topic:using blackbox in a qvt transformation called by java
Next Topic:Dependency transformation
Goto Forum:
  


Current Time: Mon Apr 21 11:29:17 EDT 2025

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

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

Back to the top