mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
fix the log output format
This commit is contained in:
parent
e0fd4ee4c1
commit
3bcc33f269
@ -22,7 +22,6 @@ import (
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/zookeeper"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/kafka"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
@ -38,7 +37,6 @@ const (
|
||||
// defaultCfgPath is the default path of the configuration file.
|
||||
defaultCfgPath = "../../../../../config/config.yaml"
|
||||
maxRetry = 300
|
||||
colorRed = 31
|
||||
)
|
||||
|
||||
var (
|
||||
@ -90,7 +88,7 @@ func main() {
|
||||
for _, check := range checks {
|
||||
err = check.function()
|
||||
if err != nil {
|
||||
ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, err))
|
||||
component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, err))
|
||||
allSuccess = false
|
||||
} else {
|
||||
component.SuccessPrint(fmt.Sprintf("%s connected successfully", check.name))
|
||||
@ -246,12 +244,3 @@ func getEnv(key, fallback string) string {
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
|
||||
func ErrorPrint(s string) {
|
||||
colorPrint(colorRed, "%v", s)
|
||||
}
|
||||
|
||||
func colorPrint(colorCode int, format string, a ...interface{}) {
|
||||
log.Printf("\x1b[%dm%s\x1b[0m\n", colorCode, fmt.Sprintf(format, a...))
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user