sing-box/experimental/deprecated/manager.go

22 lines
343 B
Go
Raw Normal View History

2024-10-18 01:58:03 +00:00
package deprecated
import (
"context"
2024-11-07 04:02:36 +00:00
"runtime/debug"
2024-10-18 01:58:03 +00:00
"github.com/sagernet/sing/service"
)
type Manager interface {
ReportDeprecated(feature Note)
}
func Report(ctx context.Context, feature Note) {
manager := service.FromContext[Manager](ctx)
if manager == nil {
2024-11-07 04:02:36 +00:00
debug.PrintStack()
2024-10-18 01:58:03 +00:00
return
}
manager.ReportDeprecated(feature)
}