/* 
 * Copyright (c) 2015 Sebastian Brudzinski
 * 
 * See the file LICENSE for copying permission.
 */
package latexstudio.editor;

import java.util.List;

/**
 * Class responsible for logging any information to the user's
 * Logs output window.
 * 
 * @author Sebastian
 */
public class ApplicationLogger {
    private final String loggerName;
    private final OutputTopComponent otc = new TopComponentFactory<OutputTopComponent>()
            .getTopComponent(OutputTopComponent.class.getSimpleName());

    public ApplicationLogger(String loggerName) {
        this.loggerName = loggerName;
    }
    
    public void log(String message) {
        otc.logToOutput("[" + loggerName + "] " + message);
    }
    
    public void log(String[] messages) {
        for (String message : messages) {
            log(message);
        }
    }
    
    public void log(List<String> messages) {
        log((String[]) messages.toArray());
    }
    
}

@@ -132,16 +132,106 @@
 tor;%0D%0A%0D%0A
+import java.text.DateFormat;%0D%0Aimport java.text.SimpleDateFormat;%0D%0Aimport java.util.Date;%0D%0A
 import j
@@ -246,16 +246,16 @@
 .List;%0D%0A
-
 %0D%0A/**%0D%0A 
@@ -608,18 +608,121 @@
 me());%0D%0A
+    DateFormat loggerDateFormat = new SimpleDateFormat(%22MMM dd HH:mm:ss%22);%0D%0A    Date currentDate;%0D%0A    
 %0D%0A
-
     publ
@@ -867,25 +867,100 @@
     
-otc.logToOutput(%22
+currentDate = new Date();%0D%0A        otc.logToOutput(loggerDateFormat.format(currentDate) + %22 
 %5B%22 +

Add timestamps to logs issue #47