Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
CodeIgniterのLogをカラー表示にするsedスクリプト
#!/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