Skip to main content



      Home
Home » Eclipse Projects » Advanced Scripting Environment (EASE) » Logging from Java Class
Logging from Java Class [message #1730120] Thu, 21 April 2016 09:35 Go to next message
Eclipse UserFriend
Hi,
we are currently investigating EASE.
We have the following constellation:
Existing Java Classes which we want to reuse in the scripts, as there is already functionality implemented. In general this works, as I can instantiate them and then work.
Currently we have also log statements included by using Log4J / Sysout, but these statements are nowhere logged.
What needs to be done to get one common output from JavaScript and calles Java Classes? We are also able to inject a dedicated log class, which is doing this.
Any hint from your side?

Regards
Daniel
Re: Logging from Java Class [message #1730137 is a reply to message #1730120] Thu, 21 April 2016 12:41 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

basically it boils down to either reuse the output stream of the curent script engine or to set the output stream of the engine to something else.

You may call getScriptEngine() anywhere in your script to get access to the current engine (you might have multiple running at the same time). Then use either getOutputStream() / setOutputStream() to either access or change where the engine print to.
getScriptEngine().setOutputStream(java.lang.System.out) // let engine print to System.out

Similar methods are available for error and input stream.

Christian
Re: Logging from Java Class [message #1730357 is a reply to message #1730137] Mon, 25 April 2016 05:29 Go to previous message
Eclipse UserFriend
Hi,
thanks for the hint.

Regards
Daniel
Previous Topic:Multiple enableFor ?
Next Topic:Running RCPTT scripts with EASE
Goto Forum:
  


Current Time: Thu Jul 17 03:34:54 EDT 2025

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

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

Back to the top