mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 10:05:58 +08:00
fix: reconstruct the script of 'make start' 'make stop' and 'make check' (#1953)
* fix: del the error world * fix: refactoring scripts * fix: del nounset * rm set error * rm set error * replace openim::log::info * replace openim::log::info * replace openim::log::info * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * fix: fix the error output format * log * fix: fix the error * log * log * fix: fi the code error * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * fix: use printf replace the echo --------- Co-authored-by: skiffer-git <44203734@qq.com>
This commit is contained in:
+12
-6
@@ -75,12 +75,13 @@ openim::log::errexit() {
|
||||
|
||||
openim::log::install_errexit() {
|
||||
# trap ERR to provide an error handler whenever a command exits nonzero this
|
||||
# is a more verbose version of set -o errexit
|
||||
trap 'openim::log::errexit' ERR
|
||||
# is a more verbose version of
|
||||
# trap 'openim::log::errexit' ERR
|
||||
|
||||
# setting errtrace allows our ERR trap handler to be propagated to functions,
|
||||
# expansions and subshells
|
||||
set -o errtrace
|
||||
#set -o errtrace
|
||||
return 0
|
||||
}
|
||||
|
||||
# Print out the stack trace
|
||||
@@ -205,22 +206,27 @@ openim::log::status() {
|
||||
fi
|
||||
|
||||
timestamp=$(date +"[%Y-%m-%d %H:%M:%S %Z]")
|
||||
echo_log "+++ ${timestamp} ${1}"
|
||||
echo_log "${timestamp} ${1}"
|
||||
shift
|
||||
for message; do
|
||||
echo_log " ${message}"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
openim::log::success() {
|
||||
local V="${V:-0}"
|
||||
if [[ ${OPENIM_VERBOSE} < ${V} ]]; then
|
||||
return
|
||||
fi
|
||||
timestamp=$(date +"%m%d %H:%M:%S")
|
||||
echo_log -e "${COLOR_GREEN}[success ${timestamp}] ${COLOR_SUFFIX}==> " "$@"
|
||||
local timestamp=$(date +"%m%d %H:%M:%S")
|
||||
local reset_color='\033[0m'
|
||||
echo_log -e "${COLOR_GREEN}[success ${timestamp}]${COLOR_SUFFIX}==> ${COLOR_GREEN}$@${reset_color}"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function openim::log::test_log() {
|
||||
echo_log "test log"
|
||||
openim::log::info "openim::log::info"
|
||||
|
||||
Reference in New Issue
Block a user