fix: fix the stderr outpu

pull/1868/head
luhaoling 2 years ago
parent e4964bb610
commit b8ca407cda

@ -15,11 +15,9 @@
package main package main
import ( import (
"context"
"flag" "flag"
"fmt" "fmt"
"github.com/IBM/sarama" "github.com/IBM/sarama"
"github.com/OpenIMSDK/tools/log"
"github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache"
"github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cos" "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cos"
"github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/minio" "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/minio"
@ -100,12 +98,12 @@ func main() {
errInfo, err = check.function() errInfo, err = check.function()
if err != nil { if err != nil {
component.ErrorPrint(fmt.Sprintf("Starting %s failed, %v, the conneted info is:%s", check.name, err, errInfo)) component.ErrorPrint(fmt.Sprintf("Starting %s failed, %v, the conneted info is:%s", check.name, err, errInfo))
log.ZError(context.Background(), errInfo, err) fmt.Fprintln(os.Stderr, errInfo, err)
allSuccess = false allSuccess = false
break break
} else { } else {
component.SuccessPrint(fmt.Sprintf("%s connected successfully, the addr is:%s", check.name, errInfo)) component.SuccessPrint(fmt.Sprintf("%s connected successfully, the addr is:%s", check.name, errInfo))
log.ZError(context.Background(), errInfo, err) fmt.Fprintln(os.Stderr, errInfo, err)
} }
if check.name == "kafka" && errs.Unwrap(err) == ErrComponentStart { if check.name == "kafka" && errs.Unwrap(err) == ErrComponentStart {
disruptions = false disruptions = false
@ -114,12 +112,12 @@ func main() {
if allSuccess { if allSuccess {
component.SuccessPrint("All components started successfully!") component.SuccessPrint("All components started successfully!")
log.ZInfo(context.Background(), errInfo, err)
return return
} }
if disruptions { if disruptions {
component.ErrorPrint(fmt.Sprintf("component check exit,err: %v", err)) component.ErrorPrint(fmt.Sprintf("component check exit,err: %v", err))
fmt.Fprintln(os.Stderr, errInfo, err)
return return
} }
} }

Loading…
Cancel
Save