package org.texttechnologylab.project.gruppe_05_1.util;

import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import static org.texttechnologylab.project.gruppe_05_1.Main.DEBUG_LOGGING;

public class Logger {
    private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss");
    // info, warn, error with message and colors and datetime
    public static void info(String message) {
        System.out.println("\u001B[32m" + LocalTime.now().format(DATE_TIME_FORMATTER) + " INFO: " + message + "\u001B[0m");
    }

    public static void warn(String message) {
        System.out.println("\u001B[33m" + LocalTime.now().format(DATE_TIME_FORMATTER) + " WARN: " + message + "\u001B[0m");
    }

    public static void error(String message) {
        System.out.println("\u001B[31m" + LocalTime.now().format(DATE_TIME_FORMATTER) + " ERROR: " + message + "\u001B[0m");
    }

    public static void debug(String message) {
        if (DEBUG_LOGGING) {
            System.out.println("\u001B[38;5;214m" + LocalTime.now() + " DEBUG: " + message + "\u001B[0m");
        }
    }

    public static void pink(String message) {
        System.out.println("\u001B[35m" + java.time.LocalTime.now() + " PINK: " + message + "\u001B[0m");
    }
}
