# For error codes check in /usr/include/sysexits.h

toLower() {
	echo $@ | tr "[A-Z]" "[a-z]"
	return 0
}

# log (typically echos on stdout)
blendLog() {
	echo $@
	return 0
}

# log error (typically echos on stderr)
blendErr() {
	RET=$1
	shift
	echo "err ${RET}: $@" > /dev/stderr
	return 0
}

# log on stderr for debug outputs
blendDebug() {
	test -n "${DEBUG}" && echo "debug: $@" > /dev/stderr
	return 0
}



# log error and return a fail code $1
blendFail() {
	RET=$1
	shift
	echo "err ${RET}: $@" > /dev/stderr
	exit ${RET}
}
