public LoggingPreferences getLoggingPreferences() throws JSONException {
LoggingPreferences ret = new LoggingPreferences();
JSONObject json = (JSONObject) getCapability(CapabilityType.LOGGING_PREFS);
if (json != null) {
for (Object key : ImmutableList.copyOf(json.keys())) {
String logType = (String) key;
Level level = Level.parse((String) json.get(logType));
ret.enable(logType, level);
}
}