Created
March 25, 2019 16:34
-
-
Save dlfinis/90ed54bdcc31ba544b494f2a6241fef1 to your computer and use it in GitHub Desktop.
Complete read of a file with tail and color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
tail -f ${@:1} | sed --unbuffered \ | |
-e 's/\(.*INFO.*\)/\o033[90m\1\o033[39m/' \ | |
-e 's/\(.*NOTICE.*\)/\o033[37m\1\o033[39m/' \ | |
-e 's/\(.*WARNING.*\)/\o033[33m\1\o033[39m/' \ | |
-e 's/\(.*ERROR.*\)/\o033[93m\1\o033[39m/' \ | |
-e 's/\(.*CRITICAL.*\)/\o033[31m\1\o033[39m/' \ | |
-e 's/\(.*ALERT.*\)/\o033[91m\1\o033[39m/' \ | |
-e 's/\(.*EMERGENCY.*\)/\o033[95m\1\o033[39m/' \ | |
-e 's/\(\#.*\)/\o033[90m\1\o033[39m/' \ | |
-e 's/\(stacktrace\)/\o033[37m\1\o033[39m/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment