增加日志输出

This commit is contained in:
qaq
2025-08-15 20:26:31 +08:00
parent 3d20d633fe
commit 6dfe55a9f0
5 changed files with 10 additions and 48 deletions
BIN
View File
Binary file not shown.
@@ -346,20 +346,15 @@ 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,7 +353,6 @@ 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)