Commit 73375935 authored by Matija Obreza's avatar Matija Obreza
Browse files

Logging fix

parent 945a0569
......@@ -87,7 +87,7 @@ public class GGTC {
if ("-v".equals(arg)) {
// Increase logging level
org.apache.log4j.Logger logger = LogManager.getLogger("org.genesys2");
logger.setLevel(Level.toLevel(logger.getLevel().toInt() - 10000));
logger.setLevel(nextLevel(logger.getLevel().toInt()));
LOG.warn("Increasing loglevel to {}", logger.getLevel());
} else {
// Files
......@@ -142,6 +142,25 @@ public class GGTC {
}
}
private static Level nextLevel(int level) {
if (level == Level.OFF_INT) {
return Level.FATAL;
} else if (level == Level.FATAL_INT) {
return Level.ERROR;
} else if (level == Level.ERROR_INT) {
return Level.WARN;
} else if (level == Level.WARN_INT) {
return Level.INFO;
} else if (level == Level.INFO_INT) {
return Level.DEBUG;
} else if (level == Level.DEBUG_INT) {
return Level.TRACE;
} else if (level == Level.TRACE_INT) {
return Level.ALL;
}
return Level.INFO;
}
private static void printHelp() {
System.out.println("Usage: java -jar GGTC.jar <inputFile> <outputFile>");
System.out.println("\nOptions:");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment