Logger commandLineLogger = Logger.getLogger(JFit.class.getPackage().getName());
commandLineLogger.setLevel(Level.FINEST);
commandLineLogger.setUseParentHandlers(false);
StreamHandler consoleHandler = new SimpleConsoleHandler();
consoleHandler.setLevel(Level.INFO);
commandLineLogger.addHandler(consoleHandler);
CommandLineOptions commandLineOptions = CommandLineOptions.parseOptions(args, commandLineLogger);
if (commandLineOptions == null) {
// There was an error in the provided command-line args.
return;
}
Level verbosity = commandLineOptions.getVerbosity();
if (verbosity != null) {
consoleHandler.setLevel(verbosity);
}
// Log the boilerplate message.
commandLineLogger.info(toolBoilerPlate);
commandLineLogger.info(" '-h' for help.");