Sascha's Wiki

Methode zum farbigen Anzeigen von Debugausgaben

public class DebugSupport {

    public static int BLACK = 30;
    public static int RED = 31;
    public static int GREEN = 32;
    public static int YELLOW = 33;
    public static int BLUE = 34;
    public static int MAGENTA = 35;
    public static int CYAN = 36;
    public static int WHITE = 37;
    public static int BG_BLACK = 40;
    public static int BG_RED = 41;
    public static int BG_GREEN = 42;
    public static int BG_YELLOW = 43;
    public static int BG_BLUE = 44;
    public static int BG_MAGENTA = 45;
    public static int BG_CYAN = 46;
    public static int BG_WHITE = 47;

    /**
     * Gibt Debugmeldungen mit Farbcode aus
     * <p>
     * usage: <br>
     * DebugSupport.debug("HTMLName", result, DebugSupport.CYAN);
     *
     * @param TYPE MessageType
     * @param msg DebugMessage
     * @param color DebugColor
     */
    public static void debug(String TYPE, String msg, int color) {
        System.out.println((char) 27 + "[" + color + "mDEBUG_" + TYPE + " = " + msg );
    }
}

java/netbeans/debugcolors.txt · Zuletzt geändert: 2016/04/21 09:15 (Externe Bearbeitung)