Colorize tail output

后端 未结 6 557
慢半拍i
慢半拍i 2021-01-30 07:27

I\'ve been trying to make tail a little more readable for server startups. My current command filters out most of the INFO and DEBUG messages from the startup:

         


        
6条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 08:10

    You can create a colored log instead of using a complex command.

    enter image description here

    For php is like this:

    echo "^[[30;43m".$ip."^[[0m";
    

    The key point is to use Ctrl-v ctrl-[ to input a green ^[ under insert mode in vim, direct input ^[ does not work.

    enter image description here

    More info here

提交回复
热议问题