Console.log in Java extension?
Greetings, When "developing" javascripts within RTC, I find the console.log method to be very handy. What is the best "printf" method of debugging I can use from within an extension? I have a working Operation Advisor, but am now adding functionality to it and a piece is not working properly and I'd rather just use prints than debugging with Jetty at this point. Thanks! |
Accepted answer
You can use below statements to get the Log instance which will log the statements you want in ccm,log.
import org.apache.commons.logging.Log;
import com.ibm.team.repository.common.LogFactory;
private static final Log fLog= LogFactory.getLog("<Logger.Name>");
You can use fLog.debug to this instead of sysout.
You can control the log level from the log4j.properties in server\conf\ccm
log4j.logger.<Logger.Name>=debug
Dave Evans selected this answer as the correct answer
|
One other answer
P.S. I can use the collector for now, but I was just wondering if there was an eaier method to use such as a message box or just writing to the error log.
Comments
sam detweiler
commented Dec 30 '13, 8:12 p.m.
I use System.out.println and watch the server console (windows command prompt).
I'd rather debug than watch print out, too...but I've never developed anything in Java before and I didn't bother to get debugging working since it wasn't trivial. I am certain I will get to that point soon though! But I got my first extension (Operation Advisor) working nicely: An owner can't approve their own work items.
sam detweiler
commented Jan 02 '14, 12:25 p.m.
I just start my normal server in debug mode. then connect from Eclipse to a Remote app.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.