mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 02:55:58 +08:00
feat: fix openim logs and ci (#1878)
This commit is contained in:
+11
-3
@@ -131,16 +131,24 @@ openim::log::error_exit() {
|
||||
exit "${code}"
|
||||
}
|
||||
|
||||
# Log an error but keep going. Don't dump the stack or 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
|
||||
|
||||
Reference in New Issue
Block a user