log/prefix

This commit is contained in:
Marc Beninca 2024-11-13 12:08:04 +01:00
parent f332104d12
commit dae14f780e
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -9,19 +9,19 @@ LOG_LEVEL=${LOG_LEVEL_INFO}
log_debug() {
if [ "${LOG_LEVEL}" -ge "${LOG_LEVEL_DEBUG}" ]; then
echo "${@}"
echo "[DEBUG]" "${@}"
fi
}
log_error() {
if [ "${LOG_LEVEL}" -ge "${LOG_LEVEL_ERROR}" ]; then
echo "${@}"
echo "[ERROR]" "${@}"
fi
}
log_fatal() {
if [ "${LOG_LEVEL}" -ge "${LOG_LEVEL_FATAL}" ]; then
echo "${@}"
echo "[FATAL]" "${@}"
fi
}
@ -33,12 +33,12 @@ log_info() {
log_trace() {
if [ "${LOG_LEVEL}" -ge "${LOG_LEVEL_TRACE}" ]; then
echo "${@}"
echo "[TRACE]" "${@}"
fi
}
log_warn() {
if [ "${LOG_LEVEL}" -ge "${LOG_LEVEL_WARN}" ]; then
echo "${@}"
echo " [WARN]" "${@}"
fi
}