I am developing an Android project with Kotlin and Dagger 2. I have a `NetworkModule` it is supposed to provide a singleton instance of Retrofit. in which I define all those provider functions. 

All code snippet below are inside `NetworkModule` :

```
@Module
object NetworkModule {
   ...
}

```

**My 1st question:**

I want to provide a singleton of `HttpLoggingInterceptor` for `OkHttpClient`. Here is what I tried:

```
@Provides
internal fun provideLoggingInterceptor(): Interceptor {
    // compiler error: Unresolved reference 'setLevel', unresolved reference 'Level'
    return HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
}

```

But I get a compilation error: `Unresolved reference 'setLevel'` and `Unresolved reference 'Level'`, How to get rid of it?

**My 2nd question:**

I define my OkHttpClient provider function as:

```
@Provides
internal fun provideOkHttpClient(loggingInterceptor: Interceptor): OkHttpClient {
        return OkHttpClient.Builder()
                        .addInterceptor(loggingInterceptor)
                        ...
                        .build()
}

```

How can I make it so that only `addInterceptor(loggingInterceptor)` when it is in the debug model, whereas in release mode not add the `HttpLoggingInterceptor` in the above provider function?