+stdout_in_terminal=1
+[[ -t 1 ]] && stdout_in_terminal=1
+function color {
+ [[ $stdout_in_terminal == 0 ]] && return
+ for k in $*; do
+ case $k in
+ bold) tput bold 2>/dev/null;;
+ none) tput sgr0 2>/dev/null;;
+ *) tput setaf $k 2>/dev/null;;
+ esac
+ done
+}
+color_green=$(color bold 2)
+color_yellow=$(color bold 3)
+color_red=$(color bold 1)
+color_none=$(color none)
+
+function error() {
+ echo "${color_red}$@${color_none}" >&2
+}
+
+function log() {
+ echo "$@" >&2
+}