- Timestamp:
- 08/28/12 17:07:24 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-runner/src/main/java/de/ugoe/cs/quest/ui/Runner.java
r676 r677 35 35 text, swt 36 36 }; 37 38 public enum LEVELENUM { 39 OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL; 40 41 public Level getLevel() { 42 switch (this) 43 { 44 case OFF: 45 return Level.OFF; 46 case SEVERE: 47 return Level.SEVERE; 48 case ALL: 49 return Level.ALL; 50 case CONFIG: 51 return Level.CONFIG; 52 case FINE: 53 return Level.FINE; 54 case FINER: 55 return Level.FINER; 56 case FINEST: 57 return Level.FINEST; 58 case INFO: 59 return Level.INFO; 60 case WARNING: 61 return Level.WARNING; 62 default: 63 throw new AssertionError("reached source code that should be unreachable"); 64 } 65 } 66 } 37 67 38 68 /** … … 61 91 62 92 OptionParser parser = new OptionParser(); 63 OptionSpec<L evel> log4j =93 OptionSpec<LEVELENUM> log4j = 64 94 parser.accepts("log4j", "Allowed values: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL").withRequiredArg() 65 .ofType(L evel.class).defaultsTo(Level.INFO);95 .ofType(LEVELENUM.class).defaultsTo(LEVELENUM.INFO); 66 96 OptionSpec<UITYPE> ui = 67 97 parser.accepts("ui", "Allowed values: text, swt").withRequiredArg() 68 98 .ofType(UITYPE.class).defaultsTo(UITYPE.text); 69 OptionSpec<L evel> trace =99 OptionSpec<LEVELENUM> trace = 70 100 parser.accepts("trace", "Allowed values: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL").withRequiredArg() 71 .ofType(L evel.class).defaultsTo(Level.WARNING);101 .ofType(LEVELENUM.class).defaultsTo(LEVELENUM.WARNING); 72 102 OptionSet options = parser.parse(args); 73 103 74 104 List<String> startupCommands = options.nonOptionArguments(); 75 105 try { 76 if(options.valueOf(log4j)!=L evel.OFF) {77 new Log4JLogger(options.valueOf(log4j) );106 if(options.valueOf(log4j)!=LEVELENUM.OFF) { 107 new Log4JLogger(options.valueOf(log4j).getLevel()); 78 108 } 79 109 … … 81 111 { 82 112 case text: 83 TextConsole textConsole = new TextConsole(options.valueOf(trace) );113 TextConsole textConsole = new TextConsole(options.valueOf(trace).getLevel()); 84 114 for (String command : startupCommands) { 85 115 CommandExecuter.getInstance().exec(command); … … 88 118 break; 89 119 case swt: 90 MainWindow mainWindow = new MainWindow(startupCommands, options.valueOf(trace) );120 MainWindow mainWindow = new MainWindow(startupCommands, options.valueOf(trace).getLevel()); 91 121 mainWindow.open(); 92 122 break;
Note: See TracChangeset
for help on using the changeset viewer.