Ignore:
Timestamp:
08/28/12 16:56:29 (12 years ago)
Author:
sherbold
Message:
  • modified startup-parameter log4j of runner from binary into java.util.Logger.Level to define the tracing granularity; defaults to INFO)
  • the Log4JLogger now abides by the java.util.logger rules
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-runner/src/main/java/de/ugoe/cs/quest/ui/Runner.java

    r674 r676  
    3636    }; 
    3737 
    38     public enum LOG4JTYPE { 
    39         enable, disable 
    40     } 
    41  
    4238    /** 
    4339     * <p> 
     
    6561 
    6662        OptionParser parser = new OptionParser(); 
    67         OptionSpec<LOG4JTYPE> log4j = 
    68             parser.accepts("log4j", "Allowed values: enable, disable").withRequiredArg() 
    69                 .ofType(LOG4JTYPE.class).defaultsTo(LOG4JTYPE.enable); 
     63        OptionSpec<Level> log4j = 
     64            parser.accepts("log4j", "Allowed values: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL").withRequiredArg() 
     65                .ofType(Level.class).defaultsTo(Level.INFO); 
    7066        OptionSpec<UITYPE> ui = 
    7167            parser.accepts("ui", "Allowed values: text, swt").withRequiredArg() 
     
    7874        List<String> startupCommands = options.nonOptionArguments(); 
    7975        try { 
    80             switch (options.valueOf(log4j)) 
    81             { 
    82                 case enable: 
    83                     new Log4JLogger(); 
    84                     break; 
    85                 case disable: 
    86                     // do nothing 
    87                     break; 
    88                 default: 
    89                     throw new AssertionError("reached source code that should be unreachable"); 
     76            if(options.valueOf(log4j)!=Level.OFF) { 
     77                new Log4JLogger(options.valueOf(log4j)); 
    9078            } 
    9179 
Note: See TracChangeset for help on using the changeset viewer.