if(log.isDebugEnabled()) {
if(log.isErrorEnabled()) {
  private void writeSocietyFile(File configDir, ComponentData hc) throws IOException {    String configFileName = hc.getName() + ".txt";    PrintWriter writer = new PrintWriter(new FileWriter(new File(configDir, configFileName)));    try {      writer.print("society = ");      writeChildLine(writer, hc);    } catch (Exception e) {      if(log.isDebugEnabled()) {        log.error("Error writing config file: " + e);      }    }    finally {      writer.close();    }      }