diff --git a/common/errors/feature_errors.go b/common/errors/feature_errors.go index 40c0ee9b178c..8c443f276ccb 100644 --- a/common/errors/feature_errors.go +++ b/common/errors/feature_errors.go @@ -4,22 +4,19 @@ import ( "context" ) -// PrintMigrateFeatureInfo prints a notice of the upcoming feature migration. -// Place it after the source feature related config file pharser code. -// Important note: Only use this when the target migrating feature is under construction. -// Important note: Even when the target migrating feature has finished its construction, this notice can still be used yet before announcing deprecation of the old feature. +// PrintNonRemovalDeprecatedFeatureWarning prints a warning of the deprecated feature that won't be removed in the near future. // Do not remove this function even there is no reference to it. -func PrintMigrateFeatureInfo(sourceFeature string, targetFeature string) { - LogInfo(context.Background(), "The feature "+sourceFeature+" will be migrated to "+targetFeature+" in the future.") +func PrintNonRemovalDeprecatedFeatureWarning(sourceFeature string, targetFeature string) { + LogWarning(context.Background(), "The feature "+sourceFeature+" is deprecated, not recommended for using and might be removed. Please migrate to "+targetFeature+" as soon as possible.") } // PrintDeprecatedFeatureWarning prints a warning for deprecated and going to be removed feature. // Do not remove this function even there is no reference to it. func PrintDeprecatedFeatureWarning(feature string, migrateFeature string) { if len(migrateFeature) > 0 { - LogWarning(context.Background(), "This feature "+feature+" is deprecated and being migrated to "+migrateFeature+". Please update your config(s) according to release note and documentation before removal.") + LogWarning(context.Background(), "This feature "+feature+" is deprecated, will be removed soon and being migrated to "+migrateFeature+". Please update your config(s) according to release note and documentation before removal.") } else { - LogWarning(context.Background(), "This feature "+feature+" is deprecated. Please update your config(s) according to release note and documentation before removal.") + LogWarning(context.Background(), "This feature "+feature+" is deprecated and will be removed soon. Please update your config(s) according to release note and documentation before removal.") } } diff --git a/infra/conf/shadowsocks.go b/infra/conf/shadowsocks.go index 3163798d7d64..a1a0b89eac36 100644 --- a/infra/conf/shadowsocks.go +++ b/infra/conf/shadowsocks.go @@ -50,7 +50,7 @@ type ShadowsocksServerConfig struct { } func (v *ShadowsocksServerConfig) Build() (proto.Message, error) { - errors.PrintDeprecatedFeatureWarning("Shadowsocks", "VLESS Encryption") + errors.PrintNonRemovalDeprecatedFeatureWarning("Shadowsocks (with no Forward Secrecy, etc.)", "VLESS Encryption") if C.Contains(shadowaead_2022.List, v.Cipher) { return buildShadowsocks2022(v) @@ -187,7 +187,7 @@ type ShadowsocksClientConfig struct { } func (v *ShadowsocksClientConfig) Build() (proto.Message, error) { - errors.PrintDeprecatedFeatureWarning("Shadowsocks", "VLESS Encryption") + errors.PrintNonRemovalDeprecatedFeatureWarning("Shadowsocks (with no Forward Secrecy, etc.)", "VLESS Encryption") if v.Address != nil { v.Servers = []*ShadowsocksServerTarget{ diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index e24f0688ee53..b7070be717ed 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -903,13 +903,13 @@ func (p TransportProtocol) Build() (string, error) { case "kcp", "mkcp": return "mkcp", nil case "grpc": - errors.PrintDeprecatedFeatureWarning("gRPC transport (with unnecessary costs, etc.)", "XHTTP stream-up H2") + errors.PrintNonRemovalDeprecatedFeatureWarning("gRPC transport (with unnecessary costs, etc.)", "XHTTP stream-up H2") return "grpc", nil case "ws", "websocket": - errors.PrintDeprecatedFeatureWarning("WebSocket transport (with ALPN http/1.1, etc.)", "XHTTP H2 & H3") + errors.PrintNonRemovalDeprecatedFeatureWarning("WebSocket transport (with ALPN http/1.1, etc.)", "XHTTP H2 & H3") return "websocket", nil case "httpupgrade": - errors.PrintDeprecatedFeatureWarning("HTTPUpgrade transport (with ALPN http/1.1, etc.)", "XHTTP H2 & H3") + errors.PrintNonRemovalDeprecatedFeatureWarning("HTTPUpgrade transport (with ALPN http/1.1, etc.)", "XHTTP H2 & H3") return "httpupgrade", nil case "h2", "h3", "http": return "", errors.PrintRemovedFeatureError("HTTP transport (without header padding, etc.)", "XHTTP stream-one H2 & H3") diff --git a/infra/conf/trojan.go b/infra/conf/trojan.go index 885504cc9f95..b78b6ffc0c76 100644 --- a/infra/conf/trojan.go +++ b/infra/conf/trojan.go @@ -39,7 +39,7 @@ type TrojanClientConfig struct { // Build implements Buildable func (c *TrojanClientConfig) Build() (proto.Message, error) { - errors.PrintDeprecatedFeatureWarning("Trojan", "VLESS with flow") + errors.PrintNonRemovalDeprecatedFeatureWarning("Trojan (with no Flow, etc.)", "VLESS with Flow & Seed") if c.Address != nil { c.Servers = []*TrojanServerTarget{ @@ -117,7 +117,7 @@ type TrojanServerConfig struct { // Build implements Buildable func (c *TrojanServerConfig) Build() (proto.Message, error) { - errors.PrintDeprecatedFeatureWarning("Trojan", "VLESS with flow") + errors.PrintNonRemovalDeprecatedFeatureWarning("Trojan (with no Flow, etc.)", "VLESS with Flow & Seed") config := &trojan.ServerConfig{ Users: make([]*protocol.User, len(c.Clients)), diff --git a/infra/conf/vless.go b/infra/conf/vless.go index 8a03eaab662c..d34906b087ea 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -70,7 +70,7 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) { return nil, errors.New(`VLESS clients: "flow" doesn't support "` + account.Flow + `" in this version`) } if account.Flow == "" { - errors.PrintDeprecatedFeatureWarning("VLESS without flow", "VLESS with flow") + errors.PrintNonRemovalDeprecatedFeatureWarning("VLESS (with no Flow, etc.)", "VLESS with Flow & Seed") } if len(account.Testseed) < 4 { @@ -280,7 +280,7 @@ func (c *VLessOutboundConfig) Build() (proto.Message, error) { switch account.Flow { case "": - errors.PrintDeprecatedFeatureWarning("VLESS without flow", "VLESS with flow") + errors.PrintNonRemovalDeprecatedFeatureWarning("VLESS (with no Flow, etc.)", "VLESS with Flow & Seed") case vless.XRV, vless.XRV + "-udp443": default: return nil, errors.New(`VLESS users: "flow" doesn't support "` + account.Flow + `" in this version`) diff --git a/infra/conf/vmess.go b/infra/conf/vmess.go index 98c85b43d4f9..cb8ff9c98991 100644 --- a/infra/conf/vmess.go +++ b/infra/conf/vmess.go @@ -64,7 +64,7 @@ type VMessInboundConfig struct { // Build implements Buildable func (c *VMessInboundConfig) Build() (proto.Message, error) { - errors.PrintDeprecatedFeatureWarning("VMess", "VLESS Encryption") + errors.PrintNonRemovalDeprecatedFeatureWarning("VMess (with no Forward Secrecy, etc.)", "VLESS Encryption") config := &inbound.Config{} @@ -115,7 +115,7 @@ type VMessOutboundConfig struct { // Build implements Buildable func (c *VMessOutboundConfig) Build() (proto.Message, error) { - errors.PrintDeprecatedFeatureWarning("VMess", "VLESS Encryption") + errors.PrintNonRemovalDeprecatedFeatureWarning("VMess (with no Forward Secrecy, etc.)", "VLESS Encryption") config := new(outbound.Config) if c.Address != nil {