|
|
|
@ -133,14 +133,22 @@ openim::log::error_exit() {
|
|
|
|
|
|
|
|
|
|
# Log an error but keep going. Don't dump the stack or exit.
|
|
|
|
|
openim::log::error() {
|
|
|
|
|
# Define red color
|
|
|
|
|
red='\033[0;31m'
|
|
|
|
|
# No color (reset)
|
|
|
|
|
nc='\033[0m' # No Color
|
|
|
|
|
|
|
|
|
|
timestamp=$(date +"[%Y-%m-%d %H:%M:%S %Z]")
|
|
|
|
|
echo_log "!!! ${timestamp} ${1-}" >&2
|
|
|
|
|
# Apply red color for error message
|
|
|
|
|
echo_log "${red}!!! ${timestamp} ${1-}${nc}" >&2
|
|
|
|
|
shift
|
|
|
|
|
for message; do
|
|
|
|
|
echo_log " ${message}" >&2
|
|
|
|
|
# Apply red color for subsequent lines of the error message
|
|
|
|
|
echo_log "${red} ${message}${nc}" >&2
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Print an usage message to stderr. The arguments are printed directly.
|
|
|
|
|
openim::log::usage() {
|
|
|
|
|
echo_log >&2
|
|
|
|
|