Compare commits

...

4 Commits

Author SHA1 Message Date
4aa5110726 fix log 2025-02-21 14:37:01 +08:00
d4b7e7e9e6 Merge branch 'main' of https://git.apinb.com/bsm-sdk/core 2025-02-20 17:41:21 +08:00
98ee26f215 fix conf 2025-02-20 17:41:11 +08:00
0218dfd02e fix conf 2025-02-20 17:41:08 +08:00
2 changed files with 5 additions and 5 deletions

View File

@@ -41,10 +41,6 @@ func New(srvKey string, cfg any) {
log.Fatalln("ERROR: Service Not Nil", cfp)
}
if !strings.Contains(string(yamlFile), "Port:") {
log.Fatalln("ERROR: Port Not Nil", cfp)
}
// 解析YAML
err = yaml.Unmarshal(yamlFile, cfg)
if err != nil {
@@ -55,7 +51,7 @@ func New(srvKey string, cfg any) {
func NotNil(values ...string) {
for _, value := range values {
if strings.TrimSpace(value) == "" {
log.Fatalln("ERROR:Must config not nil")
log.Fatalln("ERROR:Must config key not nil")
}
}
}

View File

@@ -5,6 +5,10 @@ import (
"log"
)
func init() {
log.SetFlags(log.Ldate | log.Ltime)
}
// record INFO message. Color White
func Info(format string, a ...interface{}) {
message := fmt.Sprintf("\033[37m[Info] "+format+"\033[0m\n", a...)