package logUtils;

import java.time.LocalDateTime;
import java.util.concurrent.LinkedBlockingQueue;

public class Logger
{
    private static boolean shouldLog = false,
        threadStarted = false;

    private static LinkedBlockingQueue<String> messages = new LinkedBlockingQueue<>();

    private Logger() {}

    public static synchronized void log(String message)
    {
        if (! threadStarted && shouldLog)
        {
            new Thread(() ->
            {
                while (true)
                {
                    if (messages.size() > 0)
                    {
                        try
                        {
                            System.out.println(getTime() + " " + messages.take());
                        }
                        catch (InterruptedException e)
                        {
                            log(e.getMessage());
                        }
                    }
                }
            }).start();
            threadStarted = true;
        }
        messages.add(message);
    }

    public static void setShouldLog(boolean log) { shouldLog = log; }

    private static String getTime()
    {
        return "[" + LocalDateTime.now().getHour() + ":" +
            LocalDateTime.now().getMinute() + ":" +
            LocalDateTime.now().getSecond() + "]";
    }
}

@@ -164,874 +164,170 @@
 alse
-,%0A        threadStarted = false;%0A%0A    private static LinkedBlockingQueue%3CString%3E messages = new LinkedBlockingQueue%3C%3E();%0A%0A    private Logger() %7B%7D%0A%0A    public static synchronized void log(String message)%0A    %7B%0A        if (! threadStarted && shouldLog)%0A        %7B%0A            new Thread(() -%3E%0A            %7B%0A                while (true)%0A                %7B%0A                    if (messages.size() %3E 0)%0A                    %7B%0A                        try%0A                        %7B%0A                            System.out.println(getTime() + %22 %22 + messages.take());%0A                        %7D%0A                        catch (InterruptedException e)%0A                        %7B%0A                            log(e.getMessage());%0A                        %7D%0A                    %7D%0A                %7D%0A            %7D).start();%0A            threadStarted = true;%0A        %7D%0A        messages.add(
+;%0A%0A    private Logger() %7B%7D%0A%0A    public static synchronized void log(String message)%0A    %7B%0A        if (shouldLog)%0A            System.out.println(getTime() + %22 %22 + 
 mess

Reset the logging stuff. - Logging would full use a thread instead of using it when necessary