Skip to content

[Feature Request] Allow user to custom interceptor, including loggingInterceptorΒ #1415

@trinhnx

Description

@trinhnx

Thank you for your great work!
I used line-bot-sdk version 8.6.0 and it is helpful.
There are two points i think we could improve for better configuration

  1. Add support for adding OkHttp3.Interceptor, instead of your own Interceptor one
    https://github.com/line/line-bot-sdk-java/blob/master/clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/ApiClientBuilder.java#L133-L139
    Currently we use CurlInterceptor and with your given API there is no way to adapt current interceptor to HttpInterceptor
    Suggestion code is simple as
    public ApiClientBuilder<T> addInterceptor(Interceptor interceptor) {
        this.additionalInterceptors.add(interceptor);
        return this;
    }
  1. Do not set buildLoggingInterceptor as a default one.
    Though we can configure the log level to filter out the log, but you may provide that interceptor as an optional so Developer can use it or not.

For example i just only want to log some header then I have to

  • Disable that current logging interceptor
  • Create my own interceptor to have same logging functionality
    it is not so connivence

Thank you so much for your great work!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions