From 1919a1e86f987165a7777308b443671750094f41 Mon Sep 17 00:00:00 2001 From: Kobe Arthur Scofield <26771058+KobeArthurScofield@users.noreply.github.com> Date: Thu, 12 Sep 2024 22:38:17 +0800 Subject: [PATCH] Log: Improve feature deprecation/removal logs (#3793) * Improve feature deprecation/removal logs * Add a note about the new feature * When the feature has removed, this should be an error not a warning --- features/feature.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/features/feature.go b/features/feature.go index 7c749622..4ed71600 100644 --- a/features/feature.go +++ b/features/feature.go @@ -18,5 +18,10 @@ type Feature interface { // PrintDeprecatedFeatureWarning prints a warning for deprecated feature. func PrintDeprecatedFeatureWarning(feature string) { - errors.LogInfo(context.Background(), "You are using a deprecated feature: " + feature + ". Please update your config file with latest configuration format, or update your client software.") + errors.LogWarning(context.Background(), "You are using a deprecated feature: " + feature + ". Please update your config file(s) with latest configuration format, or update your client software.") +} + +// PrintRemovedFeatureError prints an error message for removed feature. And after long enough time the message can also be removed, use as an indicator. +func PrintRemovedFeatureError(feature string) { + errors.New("The feature " + feature + " is removed. Please update your config file(s) according to release notes and documentations.") }