org.zodiac.okhttp.Slf4jLogger Maven / Gradle / Ivy
The newest version!
package org.zodiac.okhttp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import okhttp3.logging.HttpLoggingInterceptor;
public class Slf4jLogger implements HttpLoggingInterceptor.Logger {
private final Logger log = LoggerFactory.getLogger(getClass());
@Override
public void log(String message) {
log.info(message);
}
public static HttpLoggingInterceptor.Logger getInstance() {
return Slf4jLoggerHolder.INSTANCE;
}
private static class Slf4jLoggerHolder {
private static final HttpLoggingInterceptor.Logger INSTANCE = new Slf4jLogger();
}
}