Is it possible to set the log level of Nifty specifically? Or is there any way to get rid of the flood of Nifty Info messages?
Ex:
Jan 5, 2011 2:47:40 PM de.lessvoid.nifty.effects.EffectProcessor startEffect
INFO: starting effect [(ImageOverlayPulsate)]
Jan 5, 2011 2:47:40 PM de.lessvoid.nifty.effects.EffectProcessor startEffect
INFO: starting effect [(ImageOverlayPulsate)]
Jan 5, 2011 2:47:40 PM de.lessvoid.nifty.effects.EffectProcessor startEffect
INFO: starting effect [(ImageOverlayPulsate)]
Jan 5, 2011 2:47:40 PM de.lessvoid.nifty.effects.EffectProcessor startEffect
Like any Logger by classname:
[java]Logger.getLogger("de.lessvoid.nifty").setLevel(Level.OFF);[/java]
Thanks!
Hmmm,
I have the same issue.
I tried to add your line normen but…
I still have the logs
Should I wait for Nifty to be correctly initialized before using it ?
( After the line application.getRenderManager()…getPostView(“Gui Default”).addProcessor(niftyDisplay); )
I tried to add it in different places -
In my launcher, during the initialisation of my first Nifty instance, during the simpleInit method…
( Is use more than one instance of Nifty )
Otherwise, Is there a way to display the name of all loggers ?
Thanks in advance
I added it in my main method and it worked fine:
app.start(JmeContext.Type.Display);
Logger.getLogger(“de.lessvoid.nifty”).setLevel(Level.OFF);
Thanks for the answer.
You’re using JME2 or JME3 ?
Because, in my case ( with JME3 ), it doesn’t work. I don’t know why
Since I’m using castor XML, I’m using my own instance of Log4J - perhaps it’s the cause…
Edit : I solved my problem… I didn’t use the correct logging tools
Can you post your solution? I’m facing the same issue. Works for all other classes, just not nifty. Using JME3.
Hello,
I set the nifty log level after creating the nifty display.
[java]
public class ToolbarNiftyCreator implements Callable<Object> {
private ToolbarController toolbar;
public ToolbarNiftyCreator( ToolbarController toolbar )
{
this.toolbar = toolbar;
}
@Override
public Object call() throws Exception {
Nifty nifty = toolbar.getNifty();
if( nifty == null )
{
//Create nifty
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay( ViewManager.getAssetManager(),
ViewManager.getInputManager(),
ViewManager.getAudioRenderer(),
ViewManager.getGUIViewPort() );
nifty = niftyDisplay.getNifty();
toolbar.setNifty( nifty );
nifty.fromXml("assets/Sheets/toolbar.xml", "start", toolbar );
ViewManager.getGUIViewPort().addProcessor(niftyDisplay);
Logger.getLogger("de.lessvoid.nifty").setLevel( Level.SEVERE );
}
return null;
}
[/java]