Nifty: Logging Nightmare

I started a topic back in the day where I was trying to disable the nifty logging from my application: http://hub.jmonkeyengine.org/forum/topic/how-to-disable-nifty-logging/

this worked great, except that I just added a new MENU to my application and the nightmare is back. I cannot seem to get rid of the VERY MANY Nifty logs that are flooding my console. It has to do with showing/hiding the popup menu screen that I created.

The way the popup menu that’s causing this works, is that whenever the mouse cursor is at the upper left of the screen, the update loop calls a method showGUI() that shows the GUI to the screen. This works fine except that I get these logs everytime the mouse cursor is hovering on that upper left area.

[java]INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
Oct 2, 2013 1:30:59 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform
INFO: onEndScreen has ended
[/java]

is there any additional line related to screens (mainly EndScreen) that I can add here to turn these logs off?
[java]
// set logger settings
getLoggerAndMakeHardLink(“com.jme3”).setLevel(Level.OFF);
getLoggerAndMakeHardLink(“de.lessvoid.nifty”).setLevel(Level.OFF);
getLoggerAndMakeHardLink(“NiftyInputEventHandlingLog”).setLevel(Level.OFF);
[/java]

can anyone help with this?

The only solution I’ve found is to just disable (or set to Warning / Severe) all logging in the main method:

    Logger.getLogger("").setLevel(Level.OFF);

Does this not work for you or this not an suitable solution? I use my own custom logger (So I can color encode the console text) so it’s not a big problem for me to just disable all logging and it’s the only way I’ve found to get rid of the nifty console spam.

I would agree though that Nifty logging is just insane. It has caused me a lot of problems in the past by flooding my console with text so fast that I can’t even read what it says.

No :frowning: that didn’t work for me… already tried it

Maybe this will help.
http://nifty-gui.lessvoid.com/archives/532

already read it… if you see one comment at the bottom of the thread

But I always get when switching screens: Apr 30, 2013 6:31:08 PM de.lessvoid.nifty.screen.Screen$EndScreenEndNotify perform INFO: onEndScreen has ended

I have the same issue. I am still getting the onEndScreen issue.

@void256??

I haven’t seen any logging from Nifty after disabling all logging. Maybe it has something to do with using a pop-up?

Are you absolutely sure you are using an empty string when you call getLogger("")? When I tried getting the logger from “de.lessvoid” it didn’t work for me and the logging continued. When I used getLogger with an empty string it worked.

I only ask because in your original post you have:
getLoggerAndMakeHardLink(“de.lessvoid.nifty”).setLevel(Level.OFF);
getLoggerAndMakeHardLink(“NiftyInputEventHandlingLog”).setLevel(Level.OFF);

Maybe try:
getLoggerAndMakeHardLink("").setLevel(Level.OFF);
instead?

1 Like

ha!!! no I did it by adding a string in it. So now you’re right it works… can you explain what this does exactly? is it disabling ANY log from that class? whether nifty or not

Well with using “” you are disableing ANY logger using java.util.logging at all, I strongly recommend to set it to warning or error instead.

1 Like

noted. Thx guys