Many friends, like me, compile and Debug Programs on Linux terminals. Sometimes there is a lot of output content,
Looking for the data you care about is very expensive. Later, I thought that the term could change the character color. It was so nice,
Export the output content to sed to highlight the desired characters.
For example, if my web application is published on Tomcat, I often use logger to output something.
Debug the program. So after running, I will stare at the output of Catalina. Out.
The following script prints the error in the row with the error string in Red:
#! /Bin/sh
Tail-F logs/Catalina. out | sed-E's // (error. * $/) // o033 [0; 31 m/1/o033 [0 m/G'
The following script also prints the exception in the line with the exception string in the blue sky:
Tail-F logs/Catalina. out | sed-E's // (error. * $/) // o033 [0; 31 m/1/o033 [0 m/G'-E's // (exception. * $/) // o033 [0; 36 M/1/o033 [0 m/G'
It is really much easier to catch errors in the color output. Looking at people in unknown places, the screen is green,
It looks very cool.
31 is red
32 is green
33 is yellow
34 is blue
35 is purple
36 is sky blue
37 is white
You can use these colors to highlight various requirements in different categories.