Logger Colours or Plugin

What is this about?
I want to make my logger in another colour, so I know what I logged and what Nifty did
Why does it matter?
Not.
What kind of responses are you hoping for from the community?
Something like a plug-in or special logger for colour coding my logger. Or some empty “I’ll look into it”.

So, In Eclipse, there are some plug-ins for give a logger a colour. I wondered if that’s also in the jME SDK.
If not, it’s ok.

maybe you can look at escape codes : http://stackoverflow.com/questions/5762491/how-to-print-color-in-console-using-system-out-println

If that’s the problem then most logging APIs already support color. At least log4j does… I assume JUL does but I never use JUL if I can avoid it so I don’t know.

So the answer is:
Just use a “standard” API.

I already tried Escape Codes, but that didn’t work for some reason - I’ll look into it.

Several of these threads look promising but I didn’t drill in:
https://www.google.com/search?q=jul+colored+logging&ie=utf-8&oe=utf-8

…I try not to learn anything more about JUL than I have to.

Yes.

This is how I did it:

Colourer:

public class Colourer {
    
    public enum ANSI {
        RESET("\u001B[0m"),
        BLACK("\u001B[30m"),
        RED("\u001B[31m"),
        GREEN("\u001B[32m"),
        YELLOW("\u001B[33m"),
        BLUE("\u001B[34m"),
        PURPLE("\u001B[35m"),
        CYAN("\u001B[36m"),
        WHITE("\u001B[37m")
        ;
        
        String color;
        
        private ANSI(String color) {
            this.color = color;
        }
    }
    
    public static void colour(ANSI c, String s) {
        System.out.println(c + s + ANSI.RESET);
    }
    
    public static void colour(ANSI c, List s) {
        Iterator<String> it = s.iterator();
        while (it.hasNext()) {
            String print = it.next();
            colour(c,print);
        }
 {
            
        }
    }
}

In the main class:

public static void main(String[] args) {
        Main app = new Main();
        app.start();
        LOG.addHandler(new Handler() {
            
            List str = new ArrayList();
            
            @Override
            public void publish(LogRecord record) {
                str.add(record.getLevel() + ":");
                str.add(record.getSourceClassName() + ":");
                str.add(record.getSourceMethodName() + ":");
                str.add("<" + record.getMessage() + ">");
                str.add("\n");
                
                Level level = record.getLevel();
                if(level == Level.INFO) {
                    Colourer.colour(ANSI.BLACK, str);
                } else if(level == Level.WARNING) {
                    Colourer.colour(ANSI.PURPLE, str);
                }
            }

            @Override
            public void flush() {
                
            }

            @Override
            public void close() throws SecurityException {
                
            }
            
        });
    }

it’s a really dirty way, but imo it’s ok to use this as a quick solution