Changeset 5391 for CMDIValidator
- Timestamp:
- 06/26/14 12:12:43 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CMDIValidator/trunk/cmdi-validator-tool/src/main/java/eu/clarin/cmdi/validator/tool/CMDIValidatorTool.java
r5387 r5391 57 57 private static final Locale LOCALE = Locale.ENGLISH; 58 58 private static final char OPT_DEBUG = 'd'; 59 private static final char OPT_DEBUG_TRACE = 'D'; 59 60 private static final char OPT_QUIET = 'q'; 60 61 private static final char OPT_VERBOSE = 'v'; … … 76 77 * application defaults 77 78 */ 78 boolean debugging = false;79 int debugging = 0; 79 80 boolean quiet = false; 80 81 boolean verbose = false; … … 114 115 // extract options 115 116 if (line.hasOption(OPT_DEBUG)) { 116 debugging = true; 117 debugging = 1; 118 } 119 if (line.hasOption(OPT_DEBUG_TRACE)) { 120 debugging = 2; 117 121 } 118 122 if (line.hasOption(OPT_QUIET)) { … … 178 182 org.apache.log4j.Logger.getLogger( 179 183 CMDIValidator.class.getPackage().getName()); 180 if (debugging ) {184 if (debugging > 0) { 181 185 appender.setLayout( 182 186 new org.apache.log4j.PatternLayout("[%p] %t: %m%n")); 183 log.setLevel(org.apache.log4j.Level.DEBUG); 187 if (debugging > 1) { 188 log.setLevel(org.apache.log4j.Level.TRACE); 189 } else { 190 log.setLevel(org.apache.log4j.Level.DEBUG); 191 } 184 192 } else { 185 193 if (quiet) { … … 346 354 } catch (CMDIValidatorException e) { 347 355 logger.error("error initalizing job: {}", e.getMessage()); 348 if (debugging ) {356 if (debugging > 0) { 349 357 logger.error(e.getMessage(), e); 350 358 } … … 352 360 } catch (CMDIValidatorInitException e) { 353 361 logger.error("error initializing validator: {}", e.getMessage()); 354 if (debugging ) {362 if (debugging > 0) { 355 363 logger.error(e.getMessage(), e); 356 364 } … … 381 389 .withLongOpt("debug") 382 390 .create(OPT_DEBUG)); 391 g1.addOption(OptionBuilder 392 .withDescription("enable full debugging output") 393 .withLongOpt("trace") 394 .create(OPT_DEBUG_TRACE)); 383 395 g1.addOption(OptionBuilder 384 396 .withDescription("be quiet")
Note: See TracChangeset
for help on using the changeset viewer.