Implement new deprecated warnings

This commit is contained in:
世界
2024-11-07 12:02:36 +08:00
parent 74b16ff814
commit a21eaa7de5
10 changed files with 74 additions and 23 deletions

View File

@@ -2,6 +2,7 @@ package deprecated
import (
"context"
"runtime/debug"
"github.com/sagernet/sing/service"
)
@@ -13,6 +14,7 @@ type Manager interface {
func Report(ctx context.Context, feature Note) {
manager := service.FromContext[Manager](ctx)
if manager == nil {
debug.PrintStack()
return
}
manager.ReportDeprecated(feature)