Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overload construction method EosioJavaRpcProviderImpl(), add parameter leve #15

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ public EosioJavaRpcProviderImpl(@NotNull String baseURL) throws EosioJavaRpcProv
* @throws EosioJavaRpcProviderInitializerError thrown if the base URL passed in is null.
*/
public EosioJavaRpcProviderImpl(@NotNull String baseURL, boolean enableDebug) throws EosioJavaRpcProviderInitializerError {
this(baseURL, enableDebug, Level.BODY);
}

/**
* Construct a new RPC provider instance given the base URL to use for building requests.
* @param baseURL Base URL to use for building requests.
* @param enableDebug Enable Network Log
* @param level Enable Network Log at level
* @throws EosioJavaRpcProviderInitializerError thrown if the base URL passed in is null.
*/
public EosioJavaRpcProviderImpl(@NotNull String baseURL, boolean enableDebug, Level level) throws EosioJavaRpcProviderInitializerError {
if(baseURL == null || baseURL.isEmpty()) {
throw new EosioJavaRpcProviderInitializerError(EosioJavaRpcErrorConstants.RPC_PROVIDER_BASE_URL_EMPTY);
}
Expand All @@ -86,7 +97,7 @@ public EosioJavaRpcProviderImpl(@NotNull String baseURL, boolean enableDebug) th
OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
if (enableDebug) {
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(Level.BODY);
httpLoggingInterceptor.setLevel(level);
httpClient.addInterceptor(httpLoggingInterceptor);
}

Expand Down