I have a java command line tool that turns logging off at the very beginning, then parses the command line and later possibly turns logging on again, depending on the result of command line processing.
The main method begins like this:
public static void main(final String[] args){
java.util.logging.LogManager.getLogManager().reset();
java.util.logging.Logger globalLogger = java.util.logging.Logger
.getLogger(java.util.logging.Logger.GLOBAL_LOGGER_NAME);
globalLogger.setLevel(java.util.logging.Level.OFF);
[... parse command line and possibly turn logging back on]
Now Findbugs give a "Troubling" warning that says:
Changes to logger could be lost in com.bmw.fnw.DBMainDialog.main(String[])
From the Find Bugs Description I understand that the logger could possilby on when it shouldn't.
What can I do to properly turn the logger off?