增加日志输出

This commit is contained in:
qaq
2025-08-15 20:18:56 +08:00
parent 5be8082d96
commit 3d20d633fe
5 changed files with 7 additions and 6 deletions
BIN
View File
Binary file not shown.
+5 -1
View File
@@ -346,16 +346,20 @@ func ParseService(cfg *config.ServiceConfig) (service.Service, error) {
handlerLogger.Error("init: ", err)
return nil, err
}
fmt.Println("开始注册观察器")
var observer observer.Observer
// 如果服务名以_tls结尾,则不启用观察器
if strings.HasSuffix(cfg.Name, "_tls") {
observer = nil
fmt.Println("服务名以_tls结尾,跳过观察器启用")
} else if cfg.Observer != "" {
fmt.Println("def")
observer = registry.ObserverRegistry().Get(cfg.Observer)
} else if pStats != nil {
fmt.Println("console")
observer = registry.ObserverRegistry().Get("console")
} else {
fmt.Println("err")
}
s := xservice.NewService(cfg.Name, ln, h,
+1
View File
@@ -353,6 +353,7 @@ func (s *defaultService) observeStats(ctx context.Context) {
}
isUpdated := st.IsUpdated()
fmt.Println("isUpdated", isUpdated)
if isUpdated {
inputBytes := st.Get(stats.KindInputBytes)
outputBytes := st.Get(stats.KindOutputBytes)