Claudenw commented on code in PR #204:
URL: https://github.com/apache/creadur-rat/pull/204#discussion_r1455221559
##########
apache-rat-core/src/main/java/org/apache/rat/Report.java:
##########
@@ -137,6 +139,15 @@ public static void main(String[] args) throws Exception {
// for "cl"
}
+ if (cl.hasOption(LOG_LEVEL)) {
+ try {
+ Log.Level level =
Log.Level.valueOf(cl.getOptionValue(LOG_LEVEL).toUpperCase());
+ DefaultLog.INSTANCE.setLevel(level);
+ } catch (IllegalArgumentException e) {
+ DefaultLog.INSTANCE.warn(String.format("Invalied Log Level
(%s) specified.", cl.getOptionValue(LOG_LEVEL)));
Review Comment:
fixed
##########
apache-rat-core/src/main/java/org/apache/rat/Report.java:
##########
@@ -327,6 +338,10 @@ static Options buildOptions() {
Option dir = new Option("d", "dir", false, "Used to indicate source
when using --exclude");
opts.addOption(dir);
+ opts.addOption( Option.builder().argName("level").longOpt(LOG_LEVEL)
+ .hasArgs().desc("sets the log level. Valid options are:
DEBUG, INFO, WARN, ERROR, NONE")
Review Comment:
Your are correct. I fixed it. I really could use the new apache commons CLI
but it is not out of test. Helps with getting enums from the command line.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]