Mark output messagges (log, error or warning)

This commit is contained in:
Emanuele Petriglia 2018-06-17 19:54:18 +02:00
parent 78432634fb
commit 9256e77ac2
No known key found for this signature in database
GPG Key ID: CD2F70AE16A43647

View File

@ -28,21 +28,21 @@ UPDATED="false"
# Prints a message to the standard error and exit with error code 1.
error() {
echo -e "$@" >&2
echo "[Error] $@" >&2
exit 1
}
# Prints a message to the standard erorr without terminate execution.
warn() {
if [[ "$QUIET" == "false" ]]; then
echo -e "$@" >&2
echo "[Warning] $@" >&2
fi
}
# Prints a message to the standard output.
log() {
if [[ "$VERBOSE" == "true" && "$QUIET" == "false" ]]; then
echo -e "$@"
echo "[Log] $@"
fi
}