Using logger instead of System.out

This commit is contained in:
JULIEN MASNADA
2016-01-11 22:15:10 +01:00
committed by wing328
parent 6c531142a9
commit 2161907a8f
14 changed files with 118 additions and 48 deletions

View File

@@ -7,11 +7,16 @@ import java.io.File;
import java.util.Iterator;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ConfigParser {
private static final Logger LOG = LoggerFactory.getLogger(ConfigParser.class);
public static Config read(String location) {
System.out.println("reading config from " + location);
LOG.debug("reading config from " + location);
ObjectMapper mapper = new ObjectMapper();
@@ -27,11 +32,11 @@ public class ConfigParser {
if (optionNode.getValue().isValueNode()) {
config.setOption(optionNode.getKey(), optionNode.getValue().asText());
} else {
System.out.println("omitting non-value node " + optionNode.getKey());
LOG.warn("omitting non-value node " + optionNode.getKey());
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
LOG.error(e.getMessage());
return null;
}