io.vrap.rmf.base.client.http.InternalLogger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rmf-java-base Show documentation
Show all versions of rmf-java-base Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package io.vrap.rmf.base.client.http;
import java.util.function.Supplier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
/**
* Unified logger instance to perform logging only for configured logging levels.
* Creates a hierarchy of loggers for requests and responses
*/
public class InternalLogger {
private final Logger underlyingLogger;
public static final String TOPIC_REQUEST = "request";
public static final String TOPIC_RESPONSE = "response";
protected InternalLogger(final Logger underlyingLogger) {
this.underlyingLogger = underlyingLogger;
}
public static InternalLogger getLogger(final Class> clazz) {
return new InternalLogger(LoggerFactory.getLogger(clazz));
}
public static InternalLogger getLogger(final String loggerName) {
return new InternalLogger(LoggerFactory.getLogger(loggerName));
}
public boolean isTraceEnabled() {
return underlyingLogger.isTraceEnabled();
}
public InternalLogger debug(final Supplier