|
|
@@ -1,33 +1,19 @@
|
|
|
-import Utils.LogBuilder;
|
|
|
-import com.nju.edu.logTracking.enums.SeecSystem;
|
|
|
+import com.nju.edu.logTracking.LogConsumer;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
public class Test {
|
|
|
- public static void main(String[] args) throws IOException {
|
|
|
- String data = "This is an example";
|
|
|
- String log = LogBuilder
|
|
|
- .getBuilder()
|
|
|
- .target(SeecSystem.EVAL)
|
|
|
- .source(SeecSystem.CODER)
|
|
|
- .operationType(1)
|
|
|
- .data(data)
|
|
|
- .message("be careful")
|
|
|
- .build();
|
|
|
- System.out.println(log);
|
|
|
-
|
|
|
-// //最简单使用方法,默认为medium级别
|
|
|
-// LogTrackingClient
|
|
|
-// .getClient()
|
|
|
-// .log(log)
|
|
|
-// .publish();
|
|
|
-//
|
|
|
-// LogConsumer myConsumer = new LogConsumer() {
|
|
|
-// @Override
|
|
|
-// public void run(String value) {
|
|
|
-// System.out.println(value);
|
|
|
-// }
|
|
|
-// };
|
|
|
-// myConsumer.processLog();
|
|
|
+ public static void main(String[] args) throws IOException, InterruptedException {
|
|
|
+ LogConsumer myConsumer = new LogConsumer() {
|
|
|
+ @Override
|
|
|
+ public void run(String value) {
|
|
|
+ System.out.println(value);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ myConsumer.processLog();
|
|
|
+ while(true){
|
|
|
+ System.out.println("running");
|
|
|
+ Thread.sleep(2000);
|
|
|
+ }
|
|
|
}
|
|
|
}
|