何知谦 4 лет назад
Родитель
Сommit
0dd8303ffb

+ 0 - 1
seecoder-logTracking-client/src/main/java/client/LogTrackingClient.java

@@ -61,7 +61,6 @@ public class LogTrackingClient implements logTrackingApi {
         threadPoolExecutor.execute(() -> {
             try {
                 String result = PostHelper.post("http://" + Config.SERVER + "/api/publish", logConfigDto);
-                System.out.println(result);
             } catch (IOException e) {
                 log.error(e.getMessage());
             }

BIN
seecoder-logTracking-client/target/app.jar


BIN
seecoder-logTracking-client/target/classes/client/LogTrackingClient.class


BIN
seecoder-logTracking-common/target/app.jar


BIN
seecoder-logTracking-consumer/target/app.jar


BIN
seecoder-logTracking-server/target/app.jar


BIN
seecoder-logTracking-server/target/app.jar.original


+ 40 - 31
testConnect/src/main/java/Test.java

@@ -1,35 +1,44 @@
-import Utils.LogBuilder;
-import client.LogTrackingClient;
-import com.nju.edu.logTracking.LogConsumer;
-import com.nju.edu.logTracking.enums.SeecSystem;
+import Utils.PostHelper;
+import com.nju.edu.logTracking.dto.LogConfigDto;
+import com.nju.edu.logTracking.enums.Level;
+import com.nju.edu.logTracking.enums.PublishMode;
+import com.nju.edu.logTracking.kafka.Config;
 
-public class Test {
-    public static void main(String[] args) {
-        String data = "This is an example";
-
-        //此为logBuilder,若不想使用也可自己构建log
-        //注:此logBuilder在调用build方法时会自动添加created_time属性,值为当前时间戳
-        String log = LogBuilder
-                .getBuilder()
-                .target(SeecSystem.EVAL.getName())
-                .source(SeecSystem.CODER.getName())
-                .operationType(1)
-                .data(data)
-                .message("be careful")
-                .build();
+import java.io.IOException;
 
-        //最简单使用方法,默认为medium级别
-        LogTrackingClient
-                .getClient()
-                .log(log)
-                .publish();
-
-        LogConsumer myConsumer = new LogConsumer() {
-            @Override
-            public void run(String value) {
-                System.out.println(value);
-            }
-        };
-        myConsumer.processLog();
+public class Test {
+    public static void main(String[] args) throws IOException {
+//        String data = "This is an example";
+//
+//        //此为logBuilder,若不想使用也可自己构建log
+//        //注:此logBuilder在调用build方法时会自动添加created_time属性,值为当前时间戳
+//        String log = LogBuilder
+//                .getBuilder()
+//                .target(SeecSystem.EVAL.getName())
+//                .source(SeecSystem.CODER.getName())
+//                .operationType(1)
+//                .data(data)
+//                .message("be careful")
+//                .build();
+//
+//        //最简单使用方法,默认为medium级别
+//        LogTrackingClient
+//                .getClient()
+//                .log(log)
+//                .publish();
+//
+//        LogConsumer myConsumer = new LogConsumer() {
+//            @Override
+//            public void run(String value) {
+//                System.out.println(value);
+//            }
+//        };
+//        //myConsumer.processLog();
+        LogConfigDto logConfigDto = new LogConfigDto(
+                Level.MEDIUM.getValue(),
+                PublishMode.SINGLE.getValue(),
+                "");
+        String result = PostHelper.post("http://" + Config.SERVER + "/api/publish", logConfigDto);
+        System.out.println(result);
     }
 }

BIN
testConnect/target/app.jar


BIN
testConnect/target/app.jar.original


BIN
testConnect/target/classes/Test$1.class


BIN
testConnect/target/classes/Test.class


+ 0 - 1
testConnect/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -1,2 +1 @@
-Test$1.class
 Test.class