mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 19:02:31 +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/db/unrelation"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/zookeeper"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/zookeeper"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/kafka"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/kafka"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -38,7 +37,6 @@ const (
|
|||||||
// defaultCfgPath is the default path of the configuration file.
|
// defaultCfgPath is the default path of the configuration file.
|
||||||
defaultCfgPath = "../../../../../config/config.yaml"
|
defaultCfgPath = "../../../../../config/config.yaml"
|
||||||
maxRetry = 300
|
maxRetry = 300
|
||||||
colorRed = 31
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -90,7 +88,7 @@ func main() {
|
|||||||
for _, check := range checks {
|
for _, check := range checks {
|
||||||
err = check.function()
|
err = check.function()
|
||||||
if err != nil {
|
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
|
allSuccess = false
|
||||||
} else {
|
} else {
|
||||||
component.SuccessPrint(fmt.Sprintf("%s connected successfully", check.name))
|
component.SuccessPrint(fmt.Sprintf("%s connected successfully", check.name))
|
||||||
@ -246,12 +244,3 @@ func getEnv(key, fallback string) string {
|
|||||||
}
|
}
|
||||||
return fallback
|
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