I appologise if this has been asked elswhere, but I’ve searched and can’t find an answer.
Is it possible stop/suppress a Xith3D program from printing all the “GLCapabilites” stuff etc. to the command line when it loads?
Hi!
This output has nothing to do with the Xith itself.
It is generated by JOGL by its “DefaultGLCapabilitiesChooser” while creating GLCanvas component (you using JOGL for binding aren’t you?).
I’m not sure if you have any control over this output from Xith… but this is what I can tell :)).
Bohdan.
I think this has to do with Xith logging policy… It has been discussed a few times ago but I can’t remember if they finally found a solution.
Yep, pardon I was a bit wrong… :-\
Actually, there is JOGL output kind of, which seems to be off by default. And it is controlled by system properties.
You can try and switch them on simply by ADDING corresponding system properties:
Properties props = System.getProperties();
props.put(“jogl.verbose”, “<…>”);
props.put(“jogl.debug”, “<…>”);
props.put(“jogl.verbose.DefaultGLCapabilitiesChooser”, “<…>”);
props.put(“jogl.debug.DefaultGLCapabilitiesChooser”, “<…>”);
the values <…> could be just any but null, it is not checked anyhow, only the presence of the property itself.
But this will switch the output ON… huge output 
What about output you are getting in the very beginnig… yes, this seems to do with xith’s “OldStyleGLCapabilitiesChooser”.
When you do CanvasPeer, “null” is passed for GLCapabilitiesChooser (you can dig into the code if you like) and corresponding constructor :
com.xith3d.render.jogl.CanvasPeerImpl:
public CanvasPeerImpl(RenderPeer renderPeer, Object owner, int width,
int height, int bits, boolean fullScreen, GLCapabilities gc, GLCapabilitiesChooser gcc)
will check that gcc = null, and will do gcc = new OldStyleGLCapabilitiesChooser();
and now… there is DEBUG = true, which is just hardcoded!! in OldStyleGLCapabilitiesChooser, and it is responsible for all this output for available capabilities.
So it seems there is no way really to switch it of any easy…
But recompiling OldStyleGLCapabilitiesChooser with DEBUG = false; should switch your output off for sure, I believe.
Bohdan.
It’s on the list: https://xith3d.dev.java.net/issues/show_bug.cgi?id=100 I agree that the current situation is not ideal. If you are happy recompiling the source code you can get rid of those lines.
Will.
What solution could we bring to avoid this painful recompiling ? I think a simple int flag would be suffisant, heh ?
Or we can go “jogl”-way - could be fine as well. Simply you can check for the system property “xith.verbose.GCC_OUTPUT” or whatever output… … not bad I think as well.
You can have list of few different outputs and control them independently through system properties from anywhere you want. If I set in my application somewhere
Properties props = System.getProperties();
props.put(“xith.verbose.output”, “<…no output at all…>”);
and from this moment I know that whoever doing output in xith - will not do that att all! provided of course that this property is checked.
Bohdan.
“apache logging” as it was suggested above by William, being incorporated somehow for logging purposes in xith should make a clear picture how logging is to be made, as far as I understood. As far as I concern, it requires changes to be made to xith logging policy in general…
Xith3D (CVS HEAD) is now dependant on the Apache Commons Logging API (and no longer on Log4j - not that it was actually used anyway).
The output in question which prompted this thread now goes through the logging API (with more to come). Read up on the Commons Logging API, you can use a fully fledged logging solution such as Log4j to capture the log statements and do what you like with them.
Cheers,
Will.