From e184fff6890ee6436338f99fce3c1dbd6714b532 Mon Sep 17 00:00:00 2001 From: "david.yan" Date: Thu, 27 Mar 2025 03:08:59 +0800 Subject: [PATCH] add conf.PrintInfo --- conf/new.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/conf/new.go b/conf/new.go index c0718c4..ff5e183 100644 --- a/conf/new.go +++ b/conf/new.go @@ -12,6 +12,7 @@ import ( "git.apinb.com/bsm-sdk/core/env" "git.apinb.com/bsm-sdk/core/print" + "git.apinb.com/bsm-sdk/core/utils" "git.apinb.com/bsm-sdk/core/vars" yaml "gopkg.in/yaml.v3" ) @@ -56,6 +57,12 @@ func NotNil(values ...string) { } } +func PrintInfo(port int) { + print.Info("[BSM - %s] Service Name: %s", vars.ServiceKey, vars.ServiceKey) + print.Info("[BSM - %s] Runtime Mode: %s", vars.ServiceKey, env.Runtime.Mode) + print.Info("[BSM - %s] Listen Addr: %s:%d", vars.ServiceKey, utils.GetLocationIP(), port) +} + func CheckPort(port int) int { if port <= 0 || port >= 65535 { r := rand.New(rand.NewPCG(1000, uint64(time.Now().UnixNano())))