Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning (#3804)

This commit is contained in:
Kobe Arthur Scofield 2024-09-15 12:55:54 +08:00 committed by GitHub
parent 3fed0c773f
commit 5f0642a671
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 32 additions and 25 deletions

View file

@ -7,7 +7,6 @@ import (
"github.com/xtls/xray-core/common/errors"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/strmatcher"
"github.com/xtls/xray-core/features"
"github.com/xtls/xray-core/features/dns"
)
@ -26,7 +25,7 @@ func NewStaticHosts(hosts []*Config_HostMapping, legacy map[string]*net.IPOrDoma
}
if legacy != nil {
features.PrintDeprecatedFeatureWarning("simple host mapping")
errors.PrintDeprecatedFeatureWarning("simple host mapping", "")
for domain, ip := range legacy {
matcher, err := strmatcher.Full.New(domain)