Skip to content

Instantly share code, notes, and snippets.

@Gustibimo
Created June 5, 2022 09:55
Show Gist options
  • Select an option

  • Save Gustibimo/1ad8ee3923d0c7620f643e293d6d5356 to your computer and use it in GitHub Desktop.

Select an option

Save Gustibimo/1ad8ee3923d0c7620f643e293d6d5356 to your computer and use it in GitHub Desktop.
colorize output log
#!/bin/sh
sed -unbuffered -e 's/\(.*FATAL.*\)/\o033[1;31m\1\o033[0;39m/' -e 's/\(.*ERROR.*\)/\o033[31m\1\o033[39m/' -e 's/\(.*WARN.*\)/\o033[33m\1\o033[39m/' -e 's/\(.*INFO.*\)/\o033[32m\1\o033[39m/' -e 's/\(.*DEBUG.*\)/\o033[34m\1\o033[39m/' -e 's/\(.*TRACE.*\)/\o033[30m\1\o033[39m/' -e 's/\(.*[Ee]xception.*\)/\o033[1;39m\1\o033[0;39m/'-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment