Created
July 25, 2013 02:26
Revisions
-
sevaine created this gist
Jul 25, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/bin/bash log() { local TIMESTAMP="[$(date)]" if $(echo "${1}" | grep ^WARNING 2>&1 >/dev/null); then echo "${TIMESTAMP}: $*" 1>&2 elif $(echo "${1}" | grep ^FATAL 2<&1 >/dev/null); then echo "${TIMESTAMP}: $*" 1>&2 exit 1 else echo "${TIMESTAMP}: $*" fi } SCRIPT="${BASH_SOURCE[0]}" SCRIPT_DIR="$(cd $(dirname ${SCRIPT}) && pwd)"