DEV: Use `Discourse.deprecate` instead of `logger.warn` (#15274)

This commit is contained in:
Jarek Radosz 2021-12-13 17:36:19 +01:00 committed by GitHub
parent 954ab4e0ec
commit cf84f85f3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 12 deletions

View File

@ -43,10 +43,9 @@ module SiteSettings::DeprecatedSettings
define_singleton_method old_setting do |warn: true|
if warn
logger.warn(
"`SiteSetting.#{old_setting}` has been deprecated and will be " +
"removed in the #{version} Release. Please use " +
"`SiteSetting.#{new_setting}` instead"
Discourse.deprecate(
"`SiteSetting.#{old_setting}` has been deprecated. Please use `SiteSetting.#{new_setting}` instead.",
drop_from: version
)
end
@ -61,10 +60,9 @@ module SiteSettings::DeprecatedSettings
define_singleton_method "#{old_setting}?" do |warn: true|
if warn
logger.warn(
"`SiteSetting.#{old_setting}?` has been deprecated and will be " +
"removed in the #{version} Release. Please use " +
"`SiteSetting.#{new_setting}?` instead"
Discourse.deprecate(
"`SiteSetting.#{old_setting}?` has been deprecated. Please use `SiteSetting.#{new_setting}?` instead.",
drop_from: version
)
end
@ -79,10 +77,9 @@ module SiteSettings::DeprecatedSettings
define_singleton_method "#{old_setting}=" do |val, warn: true|
if warn
logger.warn(
"`SiteSetting.#{old_setting}=` has been deprecated and will be " +
"removed in the #{version} Release. Please use " +
"`SiteSetting.#{new_setting}=` instead"
Discourse.deprecate(
"`SiteSetting.#{old_setting}=` has been deprecated. Please use `SiteSetting.#{new_setting}=` instead.",
drop_from: version
)
end