Skip to content
Snippets Groups Projects
Commit 69945d94 authored by Jürgen Walter's avatar Jürgen Walter
Browse files

improvements to console

parent e72d1123
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,7 @@ public class PMXCommandLine { ...@@ -66,7 +66,7 @@ public class PMXCommandLine {
private static final String CMD_LONG_OPT_INPUT_DIR = "trace-file"; private static final String CMD_LONG_OPT_INPUT_DIR = "trace-file";
private static final String CMD_LONG_OPT_CONFIG_FILE = "pmx-config"; private static final String CMD_LONG_OPT_CONFIG_FILE = "pmx-config";
private static final String CMD_LONG_OPT_OUTPUT_DIR = "output-dir"; private static final String CMD_LONG_OPT_OUTPUT_DIR = "output-dir";
private static final String CMD_OPT_NUM_CORE = "numCore"; private static final String CMD_OPT_NUM_CORE = "cores";
private static final HelpFormatter commandLineFormatter = new HelpFormatter(); private static final HelpFormatter commandLineFormatter = new HelpFormatter();
private static final String toolName = "Performance Model eXtractor(PMX)"; private static final String toolName = "Performance Model eXtractor(PMX)";
...@@ -122,13 +122,13 @@ public class PMXCommandLine { ...@@ -122,13 +122,13 @@ public class PMXCommandLine {
Option ignoreAfterOption = OptionBuilder.create("a"); Option ignoreAfterOption = OptionBuilder.create("a");
options.addOption(ignoreAfterOption); options.addOption(ignoreAfterOption);
OptionBuilder.withArgName("long"); OptionBuilder.withArgName("cores");
OptionBuilder.hasArgs(); OptionBuilder.hasArg();
OptionBuilder.withLongOpt(PMXCommandLine.CMD_OPT_NUM_CORE); OptionBuilder.withLongOpt(PMXCommandLine.CMD_OPT_NUM_CORE);
OptionBuilder.isRequired(false); OptionBuilder.isRequired(false);
OptionBuilder.withDescription("specifies number of cores for a host"); OptionBuilder.withDescription("specifies number of CPU cores for hosts");
OptionBuilder.withValueSeparator(' '); OptionBuilder.withValueSeparator(' ');
Option numCoresOption = OptionBuilder.create("cores"); Option numCoresOption = OptionBuilder.create("n");
options.addOption(numCoresOption); options.addOption(numCoresOption);
} }
...@@ -166,7 +166,7 @@ public class PMXCommandLine { ...@@ -166,7 +166,7 @@ public class PMXCommandLine {
//--help is no error even if the required file path is missing //--help is no error even if the required file path is missing
}else{ }else{
log.info("Error parsing arguments:"+s); log.info("Error parsing arguments:"+s);
log.info(e.getMessage()); // log.info(e.getMessage());
} }
PMXCommandLine.printUsage(); PMXCommandLine.printUsage();
} }
...@@ -198,11 +198,16 @@ public class PMXCommandLine { ...@@ -198,11 +198,16 @@ public class PMXCommandLine {
return controller; return controller;
} catch (NullPointerException e) { } catch (NullPointerException e) {
//PMXCommandLine.printUsage(); //PMXCommandLine.printUsage();
log.info(e); log.info("Nullpointer in class " + e.getStackTrace()[0].getClass() + ", method "
+ e.getStackTrace()[0].getMethodName()
+ ", Line "
+ e.getStackTrace()[0].getLineNumber());
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
log.info(e); log.info("IllegalArgumentException in class " + e.getStackTrace()[0].getClass() + ", method "
+ e.getStackTrace()[0].getMethodName() + ", Line " + e.getStackTrace()[0].getLineNumber());
} catch (IOException e) { } catch (IOException e) {
log.info(e); log.info("IOException in class " + e.getStackTrace()[0].getClass() + ", method "
+ e.getStackTrace()[0].getMethodName() + ", Line " + e.getStackTrace()[0].getLineNumber());
} }
return null; return null;
...@@ -284,7 +289,7 @@ public class PMXCommandLine { ...@@ -284,7 +289,7 @@ public class PMXCommandLine {
ConsoleAppender consoleAppender = new ConsoleAppender(simpleLayout); ConsoleAppender consoleAppender = new ConsoleAppender(simpleLayout);
BasicConfigurator.configure(consoleAppender); BasicConfigurator.configure(consoleAppender);
} catch (Exception ex) { } catch (Exception ex) {
log.error(ex); log.error("Error during inialization of logging");
} }
} }
...@@ -296,7 +301,7 @@ public class PMXCommandLine { ...@@ -296,7 +301,7 @@ public class PMXCommandLine {
FileAppender fileAppender = new FileAppender(layout, logFileName, false); FileAppender fileAppender = new FileAppender(layout, logFileName, false);
BasicConfigurator.configure(fileAppender); BasicConfigurator.configure(fileAppender);
} catch (Exception ex) { } catch (Exception ex) {
log.error(ex); log.error("Error during inialization of logging");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment