Output color log4j log information in Eclipse and MyEclipse

Reprinted: https://blog.csdn.net/leiyong0326/article/details/78494115

First effect:



0. Principle:

The core is to make Eclipse's console support ANSI Escape Color - an international standard for using specific characters to represent colors . That is, let Eclipse's Console escape (Escape) the specific characters that represent the color, instead of outputting it directly. E.g:

 

[java]  view plain copy  
 
  1. public class  HelloColor {   
  2.     publicstaticvoid main(String [] args) {    
  3.         System.out.println("Hello \u001b[1;31mred\u001b[0m world!");  
  4.     }  
  5. }  

1. Install the ANSI Escape in Console plugin for Eclipse/MyEclipse:

 

 

You can go to the eclipse marketplace to search and download. If you can't find it, you can use the plugin I compiled and merge it with the plugins directory in the eclipse directory. Download address: http://download.csdn.net/download/leiyong0326/10112547

 

2. Restart the IDE, as shown below, it means success

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326074378&siteId=291194637