本文整理汇总了Java中feign.Logger.Level类的典型用法代码示例。如果您正苦于以下问题:Java Level类的具体用法?Java Level怎么用?Java Level使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Level类属于feign.Logger包,在下文中一共展示了Level类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: data
import feign.Logger.Level; //导入依赖的package包/类
@Parameters
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
{Level.NONE, Arrays.asList()},
{Level.BASIC, Arrays.asList(
"\\[SendsStuff#login\\] ---> POST http://robofu.abc/ HTTP/1.1",
"\\[SendsStuff#login\\] <--- ERROR UnknownHostException: robofu.abc \\([0-9]+ms\\)")},
{Level.HEADERS, Arrays.asList(
"\\[SendsStuff#login\\] ---> POST http://robofu.abc/ HTTP/1.1",
"\\[SendsStuff#login\\] Content-Type: application/json",
"\\[SendsStuff#login\\] Content-Length: 80",
"\\[SendsStuff#login\\] ---> END HTTP \\(80-byte body\\)",
"\\[SendsStuff#login\\] <--- ERROR UnknownHostException: robofu.abc \\([0-9]+ms\\)")},
{Level.FULL, Arrays.asList(
"\\[SendsStuff#login\\] ---> POST http://robofu.abc/ HTTP/1.1",
"\\[SendsStuff#login\\] Content-Type: application/json",
"\\[SendsStuff#login\\] Content-Length: 80",
"\\[SendsStuff#login\\] ",
"\\[SendsStuff#login\\] \\{\"customer_name\": \"netflix\", \"user_name\": \"denominator\", \"password\": \"password\"\\}",
"\\[SendsStuff#login\\] ---> END HTTP \\(80-byte body\\)",
"\\[SendsStuff#login\\] <--- ERROR UnknownHostException: robofu.abc \\([0-9]+ms\\)",
"\\[SendsStuff#login\\] java.net.UnknownHostException: robofu.abc.*",
"\\[SendsStuff#login\\] <--- END ERROR")}
});
}
开发者ID:wenwu315,项目名称:XXXX,代码行数:26,代码来源:LoggerTest.java
示例2: getNextService
import feign.Logger.Level; //导入依赖的package包/类
/**
* This is were the "magic" happens: it creates a Feign, which is a proxy interface for remote calling a REST endpoint with
* Hystrix fallback support.
*
* @return The feign pointing to the service URL and with Hystrix fallback.
*/
private NamasteService getNextService() {
final String serviceName = "namaste";
// This stores the Original/Parent ServerSpan from ZiPkin.
final ServerSpan serverSpan = brave.serverSpanThreadBinder().getCurrentServerSpan();
final CloseableHttpClient httpclient =
HttpClients.custom()
.addInterceptorFirst(new BraveHttpRequestInterceptor(brave.clientRequestInterceptor(), new DefaultSpanNameProvider()))
.addInterceptorFirst(new BraveHttpResponseInterceptor(brave.clientResponseInterceptor()))
.build();
String url = String.format("http://%s:8080/", serviceName);
return HystrixFeign.builder()
// Use apache HttpClient which contains the ZipKin Interceptors
.client(new ApacheHttpClient(httpclient))
// Bind Zipkin Server Span to Feign Thread
.requestInterceptor((t) -> brave.serverSpanThreadBinder().setCurrentSpan(serverSpan))
.logger(new Logger.ErrorLogger()).logLevel(Level.BASIC)
.decoder(new JacksonDecoder())
.target(NamasteService.class, url,
() -> Collections.singletonList("Namaste response (fallback)"));
}
开发者ID:redhat-helloworld-msa,项目名称:hello,代码行数:27,代码来源:HelloResource.java
示例3: build
import feign.Logger.Level; //导入依赖的package包/类
/**
* Generate a new Marathon client.
*
* @param marathonProperties
* the properties containing the client information
* @return the new client
*/
@Override
public Marathon build(MarathonProperties marathonProperties) {
LOG.info("Generating Marathon client with parameters: {}", marathonProperties);
return Feign
.builder()
.encoder(new GsonEncoder(ModelUtils.GSON))
.decoder(new GsonDecoder(ModelUtils.GSON))
.logger(new Slf4jLogger(Marathon.class))
.logLevel(Level.FULL)
.errorDecoder(new DeserializingMarathonErrorDecoder())
.requestInterceptor(new BasicAuthRequestInterceptor(
marathonProperties.getUsername(), marathonProperties.getPassword()))
.requestInterceptor(template -> {
template.header(HttpHeaders.ACCEPT, "application/json");
template.header(HttpHeaders.CONTENT_TYPE, "application/json");
})
.target(Marathon.class, marathonProperties.getUrl().toString());
}
开发者ID:indigo-dc,项目名称:orchestrator,代码行数:27,代码来源:MarathonClientFactory.java
示例4: oneSignal
import feign.Logger.Level; //导入依赖的package包/类
private static OneSignalComms oneSignal() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
objectMapper.setSerializationInclusion(Include.NON_EMPTY);
JacksonDecoder decoder = new JacksonDecoder(objectMapper);
return Feign.builder()
.encoder(new JacksonEncoder(objectMapper))
.decoder(decoder)
.decode404()
.errorDecoder(new OneSignalErrorDecoder(decoder))
.logger(new Slf4jLogger())
.logLevel(Level.FULL)
.target(OneSignalComms.class, "https://onesignal.com/api/v1");
}
开发者ID:CurrencyFair,项目名称:OneSignal-Java-SDK,代码行数:16,代码来源:OneSignal.java
示例5: catalogClient
import feign.Logger.Level; //导入依赖的package包/类
@Test
public void catalogClient() {
CatalogClient mytest = Feign.builder().decoder(new JacksonDecoder()).logger(new Slf4jLogger())
.logLevel(Level.FULL).target(CatalogClient.class, "http://localhost:8500");
mytest.getServiceNodes("consul-starter-tester");
}
开发者ID:januslabs,项目名称:consul-ribbon-starter,代码行数:8,代码来源:ConsulRibbonTests.java
示例6: TelegramService
import feign.Logger.Level; //导入依赖的package包/类
/**
* @param token a unique bot's authentication token
* @param logFile path to log file
*/
public TelegramService (String token, String logFile) {
api = Feign.builder()
.encoder(new JacksonEncoder())
.decoder(new JacksonDecoder())
.logger(new Logger.JavaLogger().appendToFile(logFile))
.logLevel(Level.FULL)
.target(TelegramApi.class, URL + token);
}
开发者ID:xxlabaza,项目名称:telegram-api,代码行数:13,代码来源:TelegramService.java
示例7: logModule
import feign.Logger.Level; //导入依赖的package包/类
/**
* Returns a log configuration module or null if none is needed.
*/
static Object logModule(boolean quiet, boolean verbose) {
checkArgument(!(quiet && verbose), "quiet and verbose flags cannot be used at the same time!");
Logger.Level logLevel;
if (quiet) {
return null;
} else if (verbose) {
logLevel = Logger.Level.FULL;
} else {
logLevel = Logger.Level.BASIC;
}
return new LogModule(logLevel);
}
开发者ID:Netflix,项目名称:denominator,代码行数:16,代码来源:Denominator.java
示例8: LogLevelEmitsTest
import feign.Logger.Level; //导入依赖的package包/类
public LogLevelEmitsTest(Level logLevel, List<String> expectedMessages) {
this.logLevel = logLevel;
logger.expectMessages(expectedMessages);
}
开发者ID:wenwu315,项目名称:XXXX,代码行数:5,代码来源:LoggerTest.java
示例9: ReasonPhraseOptional
import feign.Logger.Level; //导入依赖的package包/类
public ReasonPhraseOptional(Level logLevel, List<String> expectedMessages) {
this.logLevel = logLevel;
logger.expectMessages(expectedMessages);
}
开发者ID:wenwu315,项目名称:XXXX,代码行数:5,代码来源:LoggerTest.java
示例10: ReadTimeoutEmitsTest
import feign.Logger.Level; //导入依赖的package包/类
public ReadTimeoutEmitsTest(Level logLevel, List<String> expectedMessages) {
this.logLevel = logLevel;
logger.expectMessages(expectedMessages);
}
开发者ID:wenwu315,项目名称:XXXX,代码行数:5,代码来源:LoggerTest.java
示例11: UnknownHostEmitsTest
import feign.Logger.Level; //导入依赖的package包/类
public UnknownHostEmitsTest(Level logLevel, List<String> expectedMessages) {
this.logLevel = logLevel;
logger.expectMessages(expectedMessages);
}
开发者ID:wenwu315,项目名称:XXXX,代码行数:5,代码来源:LoggerTest.java
示例12: RetryEmitsTest
import feign.Logger.Level; //导入依赖的package包/类
public RetryEmitsTest(Level logLevel, List<String> expectedMessages) {
this.logLevel = logLevel;
logger.expectMessages(expectedMessages);
}
开发者ID:wenwu315,项目名称:XXXX,代码行数:5,代码来源:LoggerTest.java
示例13: LogModule
import feign.Logger.Level; //导入依赖的package包/类
LogModule(Level logLevel) {
this.logLevel = logLevel;
}
开发者ID:Netflix,项目名称:denominator,代码行数:4,代码来源:Denominator.java
示例14: level
import feign.Logger.Level; //导入依赖的package包/类
@Provides
@Singleton
Logger.Level level() {
return logLevel;
}
开发者ID:Netflix,项目名称:denominator,代码行数:6,代码来源:Denominator.java
注:本文中的feign.Logger.Level类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论