--configure Interactive configuration
--output <arg> Set xlmtv output filename
--quiet Be quiet
---log-level Zet het logging-level. Defaultwaarde is 1; hogere waarde
- kan (veel) meer logging opleveren
+--log-level Zet het logging-level. Defaultwaarde is INFO, andere mogelijkheden zijn
+ ERROR,WARN,INFO,DEBUG en TRACE
--offset <arg> Start day for grabbing (0=today)
--days <arg> Number of days to grab
public class Config {
//constants
- public static final int LOG_INFO = 0x0001;
- public static final int LOG_DEBUG = 0x0005;
- public static final int LOG_JSON = 0x0100;
- private final static int LOG_PROGRAMME_INFO = 0x0200;
private final static int CURRENT_FILE_FORMAT=4;
- public final static int LOG_DEFAULT = LOG_INFO;
// in config file
public int niceMilliseconds;
// not stored (yet)
public boolean joinKijkwijzerRatings = true;
+ boolean fetchDetails = true;
// command-line options
boolean quiet = false;
- public int logLevel = LOG_DEFAULT;
- boolean fetchDetails = true;
String project_version;
String build_time;
}
return result;
}
-
- public boolean logJSON() {
- return (logLevel & LOG_JSON) != 0;
- }
-
- public boolean logProgrammes() {
- return (logLevel & LOG_PROGRAMME_INFO) != 0;
- }
public void setCacheFile(String cacheFile) {
cacheDbHandle = "jdbc:hsqldb:file:"+cacheFile;
.addOption(OptionBuilder
.withLongOpt("log-level")
.hasArg()
- .withDescription("Set log level (0x0100=JSON)")
+ .withDescription("Set log level (ERROR,WARN,INFO,DEBUG,TRACE)")
.create())
.addOption(OptionBuilder
.withLongOpt("license")
this.outputWriter = new PrintStream( new FileOutputStream(line.getOptionValue("output")));
}
if (line.hasOption("log-level")) {
- config.logLevel = Integer.parseInt(line.getOptionValue("log-level"));
- if (config.quiet) config.logLevel = 0;
- // TODO: make distinction between levels for console and
- // file appenders
- logger.getRootLogger().setLevel(Level.toLevel(config.logLevel, Level.INFO));
+ String arg = line.getOptionValue("log-level");
+ // TODO: make distinction between levels for console and
+ // file appenders
+ Logger.getRootLogger().setLevel(Level.toLevel(arg, Level.INFO));
}
if (line.hasOption("cache")) {
config.setCacheFile(line.getOptionValue("cache"));