Skip to content

Commit

Permalink
Add debug log
Browse files Browse the repository at this point in the history
It is said these log help resolve an issue
#4095
  • Loading branch information
yuhan6665 committed Dec 10, 2024
1 parent 8aac0e8 commit ce241cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/router/strategy_leastload.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}

Expand Down
1 change: 1 addition & 0 deletions core/xray.go
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions infra/conf/xray.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit ce241cb

Please sign in to comment.