当前位置: 首页>>代码示例>>Java>>正文


Java Level类代码示例

本文整理汇总了Java中com.ihsanbal.logging.Level的典型用法代码示例。如果您正苦于以下问题:Java Level类的具体用法?Java Level怎么用?Java Level使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Level类属于com.ihsanbal.logging包,在下文中一共展示了Level类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ApiClient

import com.ihsanbal.logging.Level; //导入依赖的package包/类
ApiClient() {
    mRetrofitBuilder = new Retrofit.Builder()
            .baseUrl("http://op.juhe.cn/")
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .addConverterFactory(GsonConverterFactory.create());

    mOkHttpClientBuilder = new OkHttpClient.Builder();
    mOkHttpClientBuilder.connectTimeout(15, TimeUnit.SECONDS);
    if (BuildConfig.DEBUG) {
        mOkHttpClientBuilder.addNetworkInterceptor(
                new LoggingInterceptor.Builder()
                        .loggable(BuildConfig.DEBUG)
                        .setLevel(Level.BODY)
                        .log(Platform.INFO)
                        .request("Request")
                        .response("Response")
                        .build()
        );
    }
}
 
开发者ID:woxingxiao,项目名称:GracefulMovies,代码行数:21,代码来源:ApiClient.java

示例2: provideOkHttpClient

import com.ihsanbal.logging.Level; //导入依赖的package包/类
@Provides
@Singleton
public OkHttpClient provideOkHttpClient(Application application, OkHttpClient.Builder builder, @Nullable Cache cache, @Nullable List<Interceptor> interceptors, @Nullable OkHttpConfiguration httpConfiguration) {
    builder.cache(cache)
            .connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS)
            .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS)
            .writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS)
            .addInterceptor(new LoggingInterceptor.Builder()
                    .loggable(BuildConfig.DEBUG)
                    .setLevel(Level.BODY)
                    .request("Request")
                    .response("Response")
                    .build());

    if (interceptors != null && !interceptors.isEmpty()) {
        for (Interceptor interceptor : interceptors) {
            builder.addInterceptor(interceptor);
        }
    }

    if (httpConfiguration != null) {
        httpConfiguration.configOkHttp(application, builder);
    }

    return builder.build();
}
 
开发者ID:harrylefit,项目名称:EazyBaseMVP,代码行数:27,代码来源:ClientModule.java

示例3: provideOkHttpClient

import com.ihsanbal.logging.Level; //导入依赖的package包/类
@Provides
    @Singleton
    OkHttpClient provideOkHttpClient() {
        OkHttpClient.Builder client = new OkHttpClient.Builder();
        client.addInterceptor(new LoggingInterceptor.Builder()
                .loggable(BuildConfig.DEBUG)
                .setLevel(Level.BASIC)
                .log(Platform.INFO)
                .tag("LoggingI")
                .request("Request")
                .response("Response")
                .addHeader("version", BuildConfig.VERSION_NAME)
                .addQueryParam("query", "0")
//                .logger((level, tag, msg) -> Log.w(tag, msg))
                .build());
        return client.build();
    }
 
开发者ID:ihsanbal,项目名称:LoggingInterceptor,代码行数:18,代码来源:NetModule.java


注:本文中的com.ihsanbal.logging.Level类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。