You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by he...@apache.org on 2024/03/05 02:00:21 UTC

(shenyu) branch master updated: refactor shenyu-sync-data-http : replace log %s -> {}. (#5465)

This is an automated email from the ASF dual-hosted git repository.

hefengen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 890e5cc5d9 refactor shenyu-sync-data-http : replace log %s -> {}. (#5465)
890e5cc5d9 is described below

commit 890e5cc5d95a0bf73c1534eb3becc2fbefec0dde
Author: frank <sh...@163.com>
AuthorDate: Tue Mar 5 10:00:15 2024 +0800

    refactor shenyu-sync-data-http : replace log %s -> {}. (#5465)
    
    Co-authored-by: moremind <he...@apache.org>
---
 .../java/org/apache/shenyu/sync/data/http/AccessTokenManager.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/shenyu-sync-data-center/shenyu-sync-data-http/src/main/java/org/apache/shenyu/sync/data/http/AccessTokenManager.java b/shenyu-sync-data-center/shenyu-sync-data-http/src/main/java/org/apache/shenyu/sync/data/http/AccessTokenManager.java
index 8d38e6909d..29cfc2090b 100644
--- a/shenyu-sync-data-center/shenyu-sync-data-http/src/main/java/org/apache/shenyu/sync/data/http/AccessTokenManager.java
+++ b/shenyu-sync-data-center/shenyu-sync-data-http/src/main/java/org/apache/shenyu/sync/data/http/AccessTokenManager.java
@@ -108,7 +108,7 @@ public class AccessTokenManager {
         Request request = new Request.Builder().url(url).build();
         try (Response response = this.okHttpClient.newCall(request).execute()) {
             if (!response.isSuccessful()) {
-                LOG.warn(String.format("get token from server : [%s] error", server));
+                LOG.warn("get token from server : [{}] error", server);
                 return false;
             }
             ResponseBody responseBody = response.body();
@@ -116,7 +116,7 @@ public class AccessTokenManager {
             String result = responseBody.string();
             Map<String, Object> resultMap = GsonUtils.getInstance().convertToMap(result);
             if (!String.valueOf(CommonErrorCode.SUCCESSFUL).equals(String.valueOf(resultMap.get(Constants.ADMIN_RESULT_CODE)))) {
-                LOG.warn(String.format("get token from server : [%s] error", server));
+                LOG.warn("get token from server : [{}] error", server);
                 return false;
             }
             String tokenJson = GsonUtils.getInstance().toJson(resultMap.get(Constants.ADMIN_RESULT_DATA));
@@ -127,7 +127,7 @@ public class AccessTokenManager {
             this.tokenRefreshWindow = this.tokenExpiredTime / 10;
             return true;
         } catch (IOException e) {
-            LOG.error(String.format("get token from server : [%s] error", server), e);
+            LOG.error("get token from server : [{}] error", server, e);
             return false;
         }
     }