public String doLayout(ILoggingEvent event) {
    if (!isStarted()) {
      return CoreConstants.EMPTY_STRING;
    }
    return writeLoopOnConverters(event);
  }
@Test
  public void replaceNewline() {
    String pattern = "%replace(A\nB){'\n', '\n\t'}";
    String substPattern = OptionHelper.substVars(pattern, null, lc);
    assertEquals(pattern, substPattern);
    pl.setPattern(substPattern);
    pl.start();
    StatusPrinter.print(lc);
    String val = pl.doLayout(makeLoggingEvent("", null));
    assertEquals("A\n\tB", val);
  }