Show System.out.println output with another color

后端 未结 4 1471
你的背包
你的背包 2020-12-03 15:17

I have a big project to debug, and I was wondering if there is anyway I could use to change the System.out.println method in the output of eclipse

for e

4条回答
  •  伪装坚强ぢ
    2020-12-03 16:08

    Please Refer the following code.Also refer this link for ANSI color codes. http://en.wikipedia.org/wiki/ANSI_escape_code

    public class ColourConsoleDemo {
        public static void main(String[] args) {
            // TODO code application logic here
            System.out.println("\033[0m BLACK");
            System.out.println("\033[31m RED");
            System.out.println("\033[32m GREEN");
            System.out.println("\033[33m YELLOW");
            System.out.println("\033[34m BLUE");
            System.out.println("\033[35m MAGENTA");
            System.out.println("\033[36m CYAN");
            System.out.println("\033[37m WHITE");
        }   
    }
    

提交回复
热议问题