Created
August 21, 2011 08:46
-
-
Save yuya-matsushima/1160353 to your computer and use it in GitHub Desktop.
CodeIgniterのLogをカラー表示にするsedスクリプト
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/sed -f | |
##Inspired http://d.hatena.ne.jp/y-kawaz/20110713/1310532417 | |
## MEMO | |
# [0m reset | |
# [1m bold | |
# [3m italic | |
# [4m underline | |
# [5m blink | |
# [30m black | |
# [31m red | |
# [32m green | |
# [33m yellow | |
# [34m blue | |
# [35m magenta | |
# [36m cyan | |
# [37m white | |
s/^\(ERROR\)/\x1b[31m\1\x1b[0m/ | |
s/^\(DEBUG\)/\x1b[33m\1\x1b[0m/ | |
s/^\(INFO\)/\x1b[34m\1\x1b[0m/ | |
s/\(Severity: .* --> .*$\)/\x1b[31m\1\x1b[0m/g | |
# execution time line | |
s/\(Total execution time: [0-9]*.[0-9]*$\)/\x1b[32m\1\x1b[0m/g | |
s/\(Final .* browser$\)/\x1b[32m\1\x1b[0m/g | |
# "### hoeghoge ###" line | |
s/\(### .* ###\)/\x1b[36m\1\x1b[0m/g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment