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

gomm pushed a commit to branch edge-extensions
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/edge-extensions by this push:
     new da78e54  Removed deprecated logging method
da78e54 is described below

commit da78e54e37df91fbfcedbc4f3a816ab2374c3a06
Author: daniel-gomm <[email protected]>
AuthorDate: Tue Jun 22 16:41:35 2021 +0200

    Removed deprecated logging method
---
 .../logging/evaluation/EvaluationLogger.java       | 42 ----------------------
 1 file changed, 42 deletions(-)

diff --git 
a/streampipes-logging/src/main/java/org/apache/streampipes/logging/evaluation/EvaluationLogger.java
 
b/streampipes-logging/src/main/java/org/apache/streampipes/logging/evaluation/EvaluationLogger.java
index 2d2d2bc..3317c7a 100644
--- 
a/streampipes-logging/src/main/java/org/apache/streampipes/logging/evaluation/EvaluationLogger.java
+++ 
b/streampipes-logging/src/main/java/org/apache/streampipes/logging/evaluation/EvaluationLogger.java
@@ -32,8 +32,6 @@ import java.util.Date;
 
 public class EvaluationLogger {
 
-    private final File file;
-    private String buffer = "";
     private static EvaluationLogger instance = null;
     private final MQTT mqtt;
     private final BlockingConnection connection;
@@ -44,28 +42,8 @@ public class EvaluationLogger {
     }
 
     private EvaluationLogger(){
-        String filepath = System.getenv("SP_LOGGING_FILE_PATH");
         String logging_host = System.getenv("SP_LOGGING_MQTT_HOST");
         int logging_port = 
Integer.parseInt(System.getenv("SP_LOGGING_MQTT_PORT"));
-        if(filepath==null) throw new RuntimeException("No Logging Location 
provided.");
-        if(!filepath.endsWith("/")) filepath = filepath + "/";
-        String timePrefix = new 
SimpleDateFormat("yyyy-MM-dd-HHmmss").format(new Date());
-        String FILE_NAME = "evaluation-logs.csv";
-        String fileWithPath = new StringBuilder()
-                .append(filepath)
-                .append(timePrefix)
-                .append("_")
-                .append(FILE_NAME)
-                .toString();
-        this.file = new File(fileWithPath);
-        try {
-            if(!file.exists()){
-                if(!file.getParentFile().exists()) 
file.getParentFile().mkdirs();
-                file.createNewFile();
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
 
         mqtt = new MQTT();
         try {
@@ -81,26 +59,6 @@ public class EvaluationLogger {
         }
     }
 
-    @Deprecated
-    public void addLine(Object[] elements){
-        //TODO: Remove
-        for(Object element:elements)
-            buffer += element + ",";
-        buffer += "\n";
-    }
-
-    @Deprecated
-    public void writeOut(){
-        //TODO: Remove
-        try (BufferedWriter bufferedWriter = new BufferedWriter(new 
FileWriter(file, true))){
-            bufferedWriter.append(buffer);
-            bufferedWriter.flush();
-            buffer = "";
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
     public void logMQTT(String topic, Object[] elements){
         String message = "";
         for(Object element:elements)

Reply via email to