From ce241cb82db230d70876f3e81da97862ab04fed2 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:19:35 -0500 Subject: [PATCH] Add debug log It is said these log help resolve an issue https://github.com/XTLS/Xray-core/pull/4095 --- app/router/strategy_leastload.go | 1 + core/xray.go | 1 + infra/conf/xray.go | 2 ++ 3 files changed, 4 insertions(+) diff --git a/app/router/strategy_leastload.go b/app/router/strategy_leastload.go index a4ef1c122a67..98eeef75df35 100644 --- a/app/router/strategy_leastload.go +++ b/app/router/strategy_leastload.go @@ -61,6 +61,7 @@ func (s *LeastLoadStrategy) InjectContext(ctx context.Context) { s.ctx = ctx core.RequireFeaturesAsync(s.ctx, func(observatory extension.Observatory) { s.observer = observatory + errors.LogDebug(s.ctx, "InjectContext ", observatory) }) } diff --git a/core/xray.go b/core/xray.go index 3668542c51a3..4075c2f7a43b 100644 --- a/core/xray.go +++ b/core/xray.go @@ -316,6 +316,7 @@ func (s *Instance) RequireFeaturesAsync(callback interface{}) { go func() { var finished = false for i := 0; !finished; i++ { + errors.LogDebug(s.ctx, "RequireFeaturesAsync count ", i) if i > 1000 { errors.LogError(s.ctx, "RequireFeaturesAsync failed after count ", i) break; diff --git a/infra/conf/xray.go b/infra/conf/xray.go index ee9e6dfd81b2..8193712942b0 100644 --- a/infra/conf/xray.go +++ b/infra/conf/xray.go @@ -576,6 +576,7 @@ func (c *Config) Build() (*core.Config, error) { return nil, err } config.App = append(config.App, serial.ToTypedMessage(r)) + errors.LogDebug(context.Background(), "Config append Observatory") } if c.BurstObservatory != nil { @@ -584,6 +585,7 @@ func (c *Config) Build() (*core.Config, error) { return nil, err } config.App = append(config.App, serial.ToTypedMessage(r)) + errors.LogDebug(context.Background(), "Config append BurstObservatory") } var inbounds []InboundDetourConfig