Browse Source

fix log message (#1488) (#1502)

Signed-off-by: 唐家明 <tangjiaming@kuaishou.com>
Co-authored-by: Cplus-plus <57971497+Cplus-plus@users.noreply.github.com>
Co-authored-by: 唐家明 <tangjiaming@kuaishou.com>
groot 2 days ago
parent
commit
eb54f27148

+ 7 - 1
sdk-core/src/main/java/io/milvus/client/MilvusClient.java

@@ -45,10 +45,16 @@ import io.milvus.param.resourcegroup.*;
 
 import java.util.concurrent.TimeUnit;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * The Milvus Client Interface
  */
 public interface MilvusClient {
+
+    Logger logger = LoggerFactory.getLogger(MilvusClient.class);
+
     /**
      * Timeout setting for rpc call.
      *
@@ -99,7 +105,7 @@ public interface MilvusClient {
         try {
             close(TimeUnit.MINUTES.toSeconds(1));
         } catch (InterruptedException e) {
-            System.out.println("Interrupted during shutdown Milvus client!");
+            logger.error("Interrupted during shutdown Milvus client!");
         }
     }
 

+ 0 - 1
sdk-core/src/main/java/io/milvus/orm/iterator/SearchIterator.java

@@ -227,7 +227,6 @@ public class SearchIterator {
         tailBand = getDistance(lastHit);
         String msg = String.format("set up init parameter for searchIterator width:%s tail_band:%s", width, tailBand);
         logger.debug(msg);
-//        System.out.println(msg);
     }
 
     private void updateFilteredIds(SearchResultsWrapper searchResultsWrapper) {

+ 1 - 1
sdk-core/src/main/java/io/milvus/v2/client/MilvusClientV2.java

@@ -1044,7 +1044,7 @@ public class MilvusClientV2 {
         try {
             close(TimeUnit.MINUTES.toSeconds(1));
         } catch (InterruptedException e) {
-            System.out.println("Interrupted during shutdown Milvus client!");
+            logger.error("Interrupted during shutdown Milvus client!");
         }
     }
 

+ 1 - 1
sdk-core/src/main/java/io/milvus/v2/service/collection/CollectionService.java

@@ -481,7 +481,7 @@ public class CollectionService extends BaseService {
                 Thread.sleep(500); // Sleep for 0.5 second. Adjust this value as needed.
             } catch (InterruptedException e) {
                 Thread.currentThread().interrupt();
-                System.out.println("Thread was interrupted, Failed to complete operation");
+                logger.error("Thread was interrupted, Failed to complete operation");
                 return; // or handle interruption appropriately
             }
         }

+ 1 - 1
sdk-core/src/main/java/io/milvus/v2/service/index/IndexService.java

@@ -249,7 +249,7 @@ public class IndexService extends BaseService {
                 Thread.sleep(500); // Sleep for 0.5 second. Adjust this value as needed.
             } catch (InterruptedException e) {
                 Thread.currentThread().interrupt();
-                System.out.println("Thread was interrupted, failed to complete operation");
+                logger.error("Thread was interrupted, failed to complete operation");
                 return; // or handle interruption appropriately
             }
         }

+ 1 - 1
sdk-core/src/main/java/io/milvus/v2/service/partition/PartitionService.java

@@ -152,7 +152,7 @@ public class PartitionService extends BaseService {
                 Thread.sleep(500); // Sleep for 0.5 second. Adjust this value as needed.
             } catch (InterruptedException e) {
                 Thread.currentThread().interrupt();
-                System.out.println("Thread was interrupted, failed to complete operation");
+                logger.error("Thread was interrupted, failed to complete operation");
                 return; // or handle interruption appropriately
             }
         }

+ 1 - 1
sdk-core/src/main/java/io/milvus/v2/service/vector/VectorService.java

@@ -372,7 +372,7 @@ public class VectorService extends BaseService {
         builder.addAllAnalyzerNames(analyzerNames);
 
         String params = JsonUtils.toJson(request.getAnalyzerParams());
-        System.out.println(params);
+        logger.debug(params);
         RunAnalyzerRequest runRequest = builder.addAllPlaceholder(byteStrings)
                 .setAnalyzerParams(params)
                 .setWithDetail(request.getWithDetail())