use of org.openecard.addon.AddonPropertiesException in project open-ecard by ecsec.
the class LogSettingsGroup method getLoglevel.
private static String getLoglevel(Document conf, String path) throws AddonPropertiesException {
try {
XPath p = XPathFactory.newInstance().newXPath();
XPathExpression exp = p.compile(String.format("/configuration/logger[@name='%s']", path));
Element e = (Element) exp.evaluate(conf, XPathConstants.NODE);
// no element means NO level
if (e == null) {
return "";
} else {
return e.getAttribute("level");
}
} catch (DOMException | XPathExpressionException ex) {
throw new AddonPropertiesException("Failed to operate on log config document.");
}
}
Aggregations