How to disable nifty logging?

Nifty logging is all over the place how can I disable it??? is there anything similar to



[java]

getLoggerAndMakeHardLink( “com.jme3” ).setLevel( Level.SEVERE);

[/java]



to disable Nifty logs?



I searched on the forum and google and couldn’t find much :frowning:

[java]

Logger.getLogger(“de.lessvoid.nifty”).setLevel(Level.OFF); // or Level.SEVERE

[/java]

don’t work? (i don’t use nifty - cant check it myself)

1 Like

actually there is an issue in the version of Nifty we use.

it has been fixed in the current version of Nifty and you will be able to disable it as @oxplay2 said



for now use this as a workaround

[java]

Logger root = Logger.getLogger("");

Handler[] handlers = root.getHandlers();

for (int i = 0; i < handlers.length; i++) {

if (handlers instanceof ConsoleHandler) {

((ConsoleHandler) handlers).setLevel(Level.WARNING);

}

}

[/java]

this will remove all info logging though not only nifty.

I am using the latest version of Nigty (1.3) and still oxplay2’s solutions doesn’t work.

and for your method @nehon I’m assuming thats from the package java.util.logging?



cz I get : ConsoleHandler canot be resolved into a type.

if you have doubt

ctrl+shift+I

or

ctrl+shift+O if you use eclipse


@homsi said:
I am using the latest version of Nigty (1.3) and still oxplay2's solutions doesn't work.

it's been fixed in 1.3.1

I’ll go ahead and update then, and one more question, did they figure out a way (or is there a way) to disable all Nifty buttons? the nifty hotkeys are conflicting with my game jMe buttons and I cannot figure out a way to disable them.



thanks a lot!

ok @nehon I updated to 1.3.1 and it worked thanks!!!



please guys let me know if there’s a way to disable Nifty keys, they’re eating all the input from the jMonkey hotkeys that I previously created.

This works fine with me. Logger will still print warnings and errors, but usually you want that. I don’t see the point of totally turning logging off. Makes it very hard to diagnose problems/crashes.



[java]

Logger.getLogger("").setLevel(Level.WARNING); //NOI18N

[/java]

Nag that’s fixed I have it set to severe. But any idea how to disable keyboard events? I’m trying to Turn off the space and enter from the nifty gui

@nehon said: actually there is an issue in the version of Nifty we use. it has been fixed in the current version of Nifty and you will be able to disable it as @oxplay2 said

for now use this as a workaround
[java]
Logger root = Logger.getLogger("");
Handler handlers = root.getHandlers();
for (int i = 0; i < handlers.length; i++) {
if (handlers instanceof ConsoleHandler) {
((ConsoleHandler) handlers).setLevel(Level.WARNING);
}
}
[/java]
this will remove all info logging though not only nifty.

hello, what is the root variable you use ?

For handling the keyboard events, take a look at http://kent.dl.sourceforge.net/project/nifty-gui/nifty-gui/1.3.2/nifty-gui-the-manual-1.3.2.pdf , section “Screen Level Keyboard Events” (page 77).
At least that’s the interface that looks like it applies to your situation. I have never done anything like this so I don’t know how well it will work, or whether it will work at all.