mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-07 02:06:38 +08:00
增加日志输出
This commit is contained in:
Binary file not shown.
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user