/*
 * Copyright (c) 2023 codvision.com All Rights Reserved.
 */

package com.codvision.commonfeign.config;

import feign.Logger;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * openfeign配置
 *
 * @author lingee
 * @date 2023/7/17
 */
@Configuration
@EnableFeignClients(basePackages = {"com.codvision"})
public class OpenFeignConfig {

    /**
     * 测试环境下，打印全部请求信息
     * <p>
     * 更多日志配置参见 feign.Logger.Level
     *
     * @return
     */
    @Bean
    @Profile("dev")
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }
}
