Compare commits

...

1 Commits

Author SHA1 Message Date
e184fff689 add conf.PrintInfo 2025-03-27 03:08:59 +08:00

View File

@@ -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())))