Skip to content

Commit

Permalink
Add colog utility
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Martinsson committed Mar 12, 2015
1 parent f5da94d commit bd6f72d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions colog
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/zsh -f

highlight() {
local color=$1
echo '\x1b[1m\x1b[38;5;'${color}'m'
}

reset='\x1b[0m'

info=68
warning=214
error=196
critical=128
debug=36

sed "s#WARN\(ING\)*\b#$(highlight $warning)&${reset}#i; \
s#ERR\(OR\)*\b#$(highlight $error)&${reset}#i; \
s#INF\(O\)*\b#$(highlight $info)&${reset}#i; \
s#DEBUG\b#$(highlight $debug)&${reset}#i; \
s#CRIT\(ICAL\)*\b#$(highlight $critical)&${reset}#i; "

0 comments on commit bd6f72d

Please sign in to comment.