fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptuom...@apache.org
Subject [fineract] branch develop updated: add logging support to SDK API client (FINERACT-1216)
Date Mon, 19 Oct 2020 18:20:02 GMT
This is an automated email from the ASF dual-hosted git repository.

ptuomola pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9b2d95f  add logging support to SDK API client (FINERACT-1216)
9b2d95f is described below

commit 9b2d95f9bbbce14a2d5596f0b90c95e3f3efba9d
Author: Michael Vorburger <mike@vorburger.ch>
AuthorDate: Mon Oct 19 15:20:37 2020 +0200

    add logging support to SDK API client (FINERACT-1216)
---
 .../java/org/apache/fineract/client/util/FineractClient.java     | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fineract-client/src/main/java/org/apache/fineract/client/util/FineractClient.java
b/fineract-client/src/main/java/org/apache/fineract/client/util/FineractClient.java
index 6252b01..ac8e618 100644
--- a/fineract-client/src/main/java/org/apache/fineract/client/util/FineractClient.java
+++ b/fineract-client/src/main/java/org/apache/fineract/client/util/FineractClient.java
@@ -18,6 +18,8 @@
  */
 package org.apache.fineract.client.util;
 
+import okhttp3.logging.HttpLoggingInterceptor;
+import okhttp3.logging.HttpLoggingInterceptor.Level;
 import org.apache.fineract.client.ApiClient;
 import org.apache.fineract.client.auth.ApiKeyAuth;
 import org.apache.fineract.client.auth.HttpBasicAuth;
@@ -278,6 +280,13 @@ public class FineractClient {
             return this;
         }
 
+        public Builder logging(Level level) {
+            HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
+            logging.setLevel(level);
+            getApiClient().getOkBuilder().addInterceptor(logging);
+            return this;
+        }
+
         public FineractClient build() {
             // URL
             apiClient.getAdapterBuilder().baseUrl(has("baseURL", baseURL));


Mime
View raw message