From ef4d0c3c42d4e905543db8f84d80543ffebc36d0 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 6 Apr 2022 15:33:16 +0800 Subject: [PATCH] log --- cmd/open_im_api/main.go | 7 ++++++- cmd/open_im_cms_api/main.go | 2 ++ cmd/open_im_demo/main.go | 7 ++++++- cmd/open_im_msg_gateway/main.go | 2 ++ cmd/open_im_msg_transfer/main.go | 2 ++ cmd/open_im_push/main.go | 2 ++ cmd/rpc/open_im_admin_cms/main.go | 3 ++- cmd/rpc/open_im_auth/main.go | 2 ++ cmd/rpc/open_im_friend/main.go | 2 ++ cmd/rpc/open_im_group/main.go | 2 ++ cmd/rpc/open_im_message_cms/main.go | 2 ++ cmd/rpc/open_im_msg/main.go | 2 ++ cmd/rpc/open_im_office/main.go | 2 ++ cmd/rpc/open_im_statistics/main.go | 2 ++ cmd/rpc/open_im_user/main.go | 2 ++ 15 files changed, 38 insertions(+), 3 deletions(-) diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 342d4a03a..6bbb43dbc 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -14,6 +14,7 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "flag" + "fmt" "io" "os" "strconv" @@ -138,5 +139,9 @@ func main() { go apiThird.MinioInit() ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port") flag.Parse() - r.Run(":" + strconv.Itoa(*ginPort)) + fmt.Println("start api server, port: ", *ginPort) + err := r.Run(":" + strconv.Itoa(*ginPort)) + if err != nil { + log.Error("", "run failed ", *ginPort, err.Error()) + } } diff --git a/cmd/open_im_cms_api/main.go b/cmd/open_im_cms_api/main.go index df39c4672..262020fea 100644 --- a/cmd/open_im_cms_api/main.go +++ b/cmd/open_im_cms_api/main.go @@ -3,6 +3,7 @@ package main import ( "Open_IM/internal/cms_api" "Open_IM/pkg/utils" + "fmt" "github.com/gin-gonic/gin" ) @@ -11,5 +12,6 @@ func main() { gin.SetMode(gin.ReleaseMode) router := cms_api.NewGinRouter() router.Use(utils.CorsHandler()) + fmt.Println("start cms api server, port: ", 8000) router.Run(":" + "8000") } diff --git a/cmd/open_im_demo/main.go b/cmd/open_im_demo/main.go index c35675e20..af7809547 100644 --- a/cmd/open_im_demo/main.go +++ b/cmd/open_im_demo/main.go @@ -4,6 +4,7 @@ import ( "Open_IM/internal/demo/register" "Open_IM/pkg/utils" "flag" + "fmt" "io" "os" "strconv" @@ -33,5 +34,9 @@ func main() { ginPort := flag.Int("port", 42233, "get ginServerPort from cmd,default 42233 as port") flag.Parse() - r.Run(":" + strconv.Itoa(*ginPort)) + fmt.Println("start demo api server, port: ", *ginPort) + err := r.Run(":" + strconv.Itoa(*ginPort)) + if err != nil { + log.Error("", "run failed ", *ginPort, err.Error()) + } } diff --git a/cmd/open_im_msg_gateway/main.go b/cmd/open_im_msg_gateway/main.go index 5296c9bcf..283f831b8 100644 --- a/cmd/open_im_msg_gateway/main.go +++ b/cmd/open_im_msg_gateway/main.go @@ -5,6 +5,7 @@ import ( "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" "flag" + "fmt" "sync" ) @@ -15,6 +16,7 @@ func main() { flag.Parse() var wg sync.WaitGroup wg.Add(1) + fmt.Println("start rpc/msg_gateway server, port: ", *rpcPort, *wsPort) gate.Init(*rpcPort, *wsPort) gate.Run() wg.Wait() diff --git a/cmd/open_im_msg_transfer/main.go b/cmd/open_im_msg_transfer/main.go index 2a54ac1d8..9dfabecda 100644 --- a/cmd/open_im_msg_transfer/main.go +++ b/cmd/open_im_msg_transfer/main.go @@ -4,6 +4,7 @@ import ( "Open_IM/internal/msg_transfer/logic" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" + "fmt" "sync" ) @@ -12,6 +13,7 @@ func main() { wg.Add(1) log.NewPrivateLog(constant.LogFileName) logic.Init() + fmt.Println("start msg_transfer server") logic.Run() wg.Wait() } diff --git a/cmd/open_im_push/main.go b/cmd/open_im_push/main.go index ba8dc65c1..95e8521dd 100644 --- a/cmd/open_im_push/main.go +++ b/cmd/open_im_push/main.go @@ -5,6 +5,7 @@ import ( "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" "flag" + "fmt" "sync" ) @@ -14,6 +15,7 @@ func main() { var wg sync.WaitGroup wg.Add(1) log.NewPrivateLog(constant.LogFileName) + fmt.Println("start push rpc server, port: ", *rpcPort) logic.Init(*rpcPort) logic.Run() wg.Wait() diff --git a/cmd/rpc/open_im_admin_cms/main.go b/cmd/rpc/open_im_admin_cms/main.go index eae1a4505..c69135645 100644 --- a/cmd/rpc/open_im_admin_cms/main.go +++ b/cmd/rpc/open_im_admin_cms/main.go @@ -3,12 +3,13 @@ package main import ( rpcMessageCMS "Open_IM/internal/rpc/admin_cms" "flag" + "fmt" ) func main() { rpcPort := flag.Int("port", 11000, "rpc listening port") flag.Parse() + fmt.Println("start cms rpc server, port: ", *rpcPort) rpcServer := rpcMessageCMS.NewAdminCMSServer(*rpcPort) rpcServer.Run() } - diff --git a/cmd/rpc/open_im_auth/main.go b/cmd/rpc/open_im_auth/main.go index 110ea05c6..53b0f9de5 100644 --- a/cmd/rpc/open_im_auth/main.go +++ b/cmd/rpc/open_im_auth/main.go @@ -3,11 +3,13 @@ package main import ( rpcAuth "Open_IM/internal/rpc/auth" "flag" + "fmt" ) func main() { rpcPort := flag.Int("port", 10600, "RpcToken default listen port 10800") flag.Parse() + fmt.Println("start auth rpc server, port: ", *rpcPort) rpcServer := rpcAuth.NewRpcAuthServer(*rpcPort) rpcServer.Run() diff --git a/cmd/rpc/open_im_friend/main.go b/cmd/rpc/open_im_friend/main.go index 0847699c5..85d05e39c 100644 --- a/cmd/rpc/open_im_friend/main.go +++ b/cmd/rpc/open_im_friend/main.go @@ -3,12 +3,14 @@ package main import ( "Open_IM/internal/rpc/friend" "flag" + "fmt" ) func main() { rpcPort := flag.Int("port", 10200, "get RpcFriendPort from cmd,default 12000 as port") flag.Parse() + fmt.Println("start friend rpc server, port: ", *rpcPort) rpcServer := friend.NewFriendServer(*rpcPort) rpcServer.Run() } diff --git a/cmd/rpc/open_im_group/main.go b/cmd/rpc/open_im_group/main.go index 8a3f886cb..7afc7ec57 100644 --- a/cmd/rpc/open_im_group/main.go +++ b/cmd/rpc/open_im_group/main.go @@ -3,11 +3,13 @@ package main import ( "Open_IM/internal/rpc/group" "flag" + "fmt" ) func main() { rpcPort := flag.Int("port", 10500, "get RpcGroupPort from cmd,default 16000 as port") flag.Parse() + fmt.Println("start group rpc server, port: ", *rpcPort) rpcServer := group.NewGroupServer(*rpcPort) rpcServer.Run() } diff --git a/cmd/rpc/open_im_message_cms/main.go b/cmd/rpc/open_im_message_cms/main.go index 0980d3629..16151a2ed 100644 --- a/cmd/rpc/open_im_message_cms/main.go +++ b/cmd/rpc/open_im_message_cms/main.go @@ -3,11 +3,13 @@ package main import ( rpcMessageCMS "Open_IM/internal/rpc/message_cms" "flag" + "fmt" ) func main() { rpcPort := flag.Int("port", 10900, "rpc listening port") flag.Parse() + fmt.Println("start msg cms rpc server, port: ", *rpcPort) rpcServer := rpcMessageCMS.NewMessageCMSServer(*rpcPort) rpcServer.Run() } diff --git a/cmd/rpc/open_im_msg/main.go b/cmd/rpc/open_im_msg/main.go index 7344facf4..95908f48a 100644 --- a/cmd/rpc/open_im_msg/main.go +++ b/cmd/rpc/open_im_msg/main.go @@ -3,11 +3,13 @@ package main import ( rpcChat "Open_IM/internal/rpc/msg" "flag" + "fmt" ) func main() { rpcPort := flag.Int("port", 10300, "rpc listening port") flag.Parse() + fmt.Println("start msg rpc server, port: ", *rpcPort) rpcServer := rpcChat.NewRpcChatServer(*rpcPort) rpcServer.Run() } diff --git a/cmd/rpc/open_im_office/main.go b/cmd/rpc/open_im_office/main.go index c4d80cf68..c9a05c791 100644 --- a/cmd/rpc/open_im_office/main.go +++ b/cmd/rpc/open_im_office/main.go @@ -3,11 +3,13 @@ package main import ( rpc "Open_IM/internal/rpc/office" "flag" + "fmt" ) func main() { rpcPort := flag.Int("port", 11100, "rpc listening port") flag.Parse() + fmt.Println("start office rpc server, port: ", *rpcPort) rpcServer := rpc.NewOfficeServer(*rpcPort) rpcServer.Run() } diff --git a/cmd/rpc/open_im_statistics/main.go b/cmd/rpc/open_im_statistics/main.go index f1f950288..b87440abf 100644 --- a/cmd/rpc/open_im_statistics/main.go +++ b/cmd/rpc/open_im_statistics/main.go @@ -3,11 +3,13 @@ package main import ( "Open_IM/internal/rpc/statistics" "flag" + "fmt" ) func main() { rpcPort := flag.Int("port", 10800, "rpc listening port") flag.Parse() + fmt.Println("start statistics rpc server, port: ", *rpcPort) rpcServer := statistics.NewStatisticsServer(*rpcPort) rpcServer.Run() } diff --git a/cmd/rpc/open_im_user/main.go b/cmd/rpc/open_im_user/main.go index 91b6e55b5..d8644d028 100644 --- a/cmd/rpc/open_im_user/main.go +++ b/cmd/rpc/open_im_user/main.go @@ -3,11 +3,13 @@ package main import ( "Open_IM/internal/rpc/user" "flag" + "fmt" ) func main() { rpcPort := flag.Int("port", 10100, "rpc listening port") flag.Parse() + fmt.Println("start user rpc server, port: ", *rpcPort) rpcServer := user.NewUserServer(*rpcPort) rpcServer.Run() }