mirror of
https://github.com/arkenfox/user.js.git
synced 2025-05-24 00:07:10 +02:00
Mark output messagges (log, error or warning)
This commit is contained in:
parent
78432634fb
commit
9256e77ac2
1 changed files with 3 additions and 3 deletions
|
@ -28,21 +28,21 @@ UPDATED="false"
|
||||||
|
|
||||||
# Prints a message to the standard error and exit with error code 1.
|
# Prints a message to the standard error and exit with error code 1.
|
||||||
error() {
|
error() {
|
||||||
echo -e "$@" >&2
|
echo "[Error] $@" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prints a message to the standard erorr without terminate execution.
|
# Prints a message to the standard erorr without terminate execution.
|
||||||
warn() {
|
warn() {
|
||||||
if [[ "$QUIET" == "false" ]]; then
|
if [[ "$QUIET" == "false" ]]; then
|
||||||
echo -e "$@" >&2
|
echo "[Warning] $@" >&2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prints a message to the standard output.
|
# Prints a message to the standard output.
|
||||||
log() {
|
log() {
|
||||||
if [[ "$VERBOSE" == "true" && "$QUIET" == "false" ]]; then
|
if [[ "$VERBOSE" == "true" && "$QUIET" == "false" ]]; then
|
||||||
echo -e "$@"
|
echo "[Log] $@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue