Mercurial > hg > Database > Alice
view src/main/java/alice/daemon/Config.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children | fdf17b55a668 |
line wrap: on
line source
package alice.daemon; import org.apache.log4j.Level; public class Config { public int localPort = 10000; public String logFile = null; public Level level = null; public Config(String[] args) { for (int i = 0; i< args.length; i++) { if ("-p".equals(args[i])) { localPort = Integer.parseInt(args[++i]); } else if ("-log".equals(args[i])) { logFile = args[++i]; } else if ("-level".equals(args[i])) { String levelStr = args[++i]; if (levelStr.equals("fatal")) { level = Level.FATAL; } else if (levelStr.equals("error")) { level = Level.ERROR; } else if (levelStr.equals("warn")) { level = Level.WARN; } else if (levelStr.equals("info")) { level = Level.INFO; } else if (levelStr.equals("debug")) { level = Level.DEBUG; } } } } }