From 27d88fdf94b81ae6af3968c4c17cb5e823d974fd Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Thu, 22 Feb 2024 18:24:19 +0800 Subject: [PATCH] replace openim::log::info --- scripts/lib/util.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index 38f2a2956..2bea0c592 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -402,7 +402,7 @@ openim::util::check_process_names() { local not_started=() local started=() - openim::log::info "Checking processes: $*" + echo "Checking processes: $*" # Iterate over each given process name for process_name in "$@"; do # Use `pgrep` to find process IDs related to the given process name @@ -1588,7 +1588,7 @@ openim::util::check_ports() { # An array to collect information about processes that are running. local started=() - openim::log::info "Checking ports: $*" + echo "Checking ports: $*" # Iterate over each given port. for port in "$@"; do # Initialize variables @@ -1634,7 +1634,7 @@ openim::util::check_ports() { # Print information about ports whose processes are not running. if [[ ${#not_started[@]} -ne 0 ]]; then - openim::log::info "\n### Not started ports:" + echo "\n### Not started ports:" for port in "${not_started[@]}"; do openim::log::error "Port $port is not started." done @@ -1642,9 +1642,9 @@ openim::util::check_ports() { # Print information about ports whose processes are running. if [[ ${#started[@]} -ne 0 ]]; then - openim::log::info "\n### Started ports:" + echo "\n### Started ports:" for info in "${started[@]}"; do - openim::log::info "$info" + echo "$info" done fi @@ -1693,7 +1693,7 @@ openim::util::check_process_names() { local not_started=() local started=() - openim::log::info "Checking processes: $*" + echo "Checking processes: $*" # Iterate over each given process name for process_name in "$@"; do # Use `pgrep` to find process IDs related to the given process name @@ -1721,7 +1721,7 @@ openim::util::check_process_names() { # Print information if [[ ${#not_started[@]} -ne 0 ]]; then - openim::log::info "Not started processes:" + echo "Not started processes:" for process_name in "${not_started[@]}"; do openim::log::error "Process $process_name is not started." done @@ -1729,9 +1729,9 @@ openim::util::check_process_names() { if [[ ${#started[@]} -ne 0 ]]; then echo - openim::log::info "Started processes:" + echo "Started processes:" for info in "${started[@]}"; do - openim::log::info "$info" + echo "$info" done fi @@ -1764,7 +1764,7 @@ openim::util::stop_services_on_ports() { # An array to collect information about processes that were stopped. local stopped=() - openim::log::info "Stopping services on ports: $*" + echo "Stopping services on ports: $*" # Iterate over each given port. for port in "$@"; do # Use the `lsof` command to find process information related to the given port. @@ -1788,7 +1788,7 @@ openim::util::stop_services_on_ports() { # Print information about ports whose processes couldn't be stopped. if [[ ${#not_stopped[@]} -ne 0 ]]; then - openim::log::info "Ports that couldn't be stopped:" + echo "Ports that couldn't be stopped:" for port in "${not_stopped[@]}"; do openim::log::status "Failed to stop service on port $port." done @@ -1797,7 +1797,7 @@ openim::util::stop_services_on_ports() { # Print information about ports whose processes were successfully stopped. if [[ ${#stopped[@]} -ne 0 ]]; then for port in "${stopped[@]}"; do - openim::log::info "Successfully stopped service on port $port." + echo "Successfully stopped service on port $port." done fi @@ -1830,7 +1830,7 @@ openim::util::stop_services_with_name() { # An array to collect information about processes that were stopped. local stopped=() - openim::log::info "Stopping services with names: $*" + echo "Stopping services with names: $*" # Iterate over each given service name. for server_name in "$@"; do # Use the `pgrep` command to find process IDs related to the given service name. @@ -1867,7 +1867,7 @@ openim::util::stop_services_with_name() { # Print information about services whose processes couldn't be stopped. if [[ ${#not_stopped[@]} -ne 0 ]]; then - openim::log::info "Services that couldn't be stopped:" + echo "Services that couldn't be stopped:" for name in "${not_stopped[@]}"; do openim::log::status "Failed to stop the $name service." done @@ -1876,9 +1876,9 @@ openim::util::stop_services_with_name() { # Print information about services whose processes were successfully stopped. if [[ ${#stopped[@]} -ne 0 ]]; then echo - openim::log::info "Stopped services:" + echo "Stopped services:" for name in "${stopped[@]}"; do - openim::log::info "Successfully stopped the $name service." + echo "Successfully stopped the $name service." done fi