class Slf4jLogger extends feign.Logger {

  @Override
  protected void log(String configKey, String format, Object... args) {
    // Not using SLF4J's support for parameterized messages (even though it would be more efficient)
    // because it would
    // require the incoming message formats to be SLF4J-specific.
    if (logger.isDebugEnabled()) {
      logger.debug(String.format(methodTag(configKey) + format, args));
    }
  }

}

class Slf4jLoggerTest {

  private static final String CONFIG_KEY;
  private static final Request REQUEST;
  private static final Response RESPONSE;
  @Rule
  public final RecordingSimpleLogger slf4j;
  private Slf4jLogger logger;

  @Test
  public void useLoggerByNameIfRequested() throws Exception {

    slf4j.logLevel("debug");
    slf4j.expectMessages(
        "DEBUG named.logger - [someMethod] This is my message" + System.lineSeparator());

    logger = new Slf4jLogger("named.logger");
    logger.log(CONFIG_KEY, "This is my message");
  }

}