All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.touchbit.buggy.feign.FeignCallLogger Maven / Gradle / Ivy

The newest version!
package org.touchbit.buggy.feign;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.function.Consumer;

/**
 * Created by Oleg Shaburov on 13.10.2018
 * [email protected]
 */
public class FeignCallLogger extends feign.Logger {

    private final Consumer logMethod;

    public FeignCallLogger() {
        this(LoggerFactory.getLogger(FeignCallLogger.class));
    }

    public FeignCallLogger(final Logger logger) {
        this(logger::info);
    }

    public FeignCallLogger(final Consumer logMethod) {
        this.logMethod = logMethod;
    }

    @Override
    protected void log(String configKey, String format, Object... args) {
        String msg = methodTag(configKey) + format;
        logMethod.accept(String.format(msg, args));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy