summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-05-17 18:53:06 +0000
committerMayra Cabrera <mcabrera@gitlab.com>2018-05-17 13:56:03 -0500
commit9446d49aae19c2416fd152399b7e4efa3c6cbfc2 (patch)
treea15f56a77731f265615dfe800cfab5015996f4f4
parent48d54c52f745e44b24cd6590abacb6496cb026c6 (diff)
downloadgitlab-ce-10-8-stable-prepare-rc12.tar.gz
Merge branch 'sh-remove-deprecation-warnings-from-com' into 'master'10-8-stable-prepare-rc12
Conditionally enable deprecation log messages Closes #46158 and gitlab-com/infrastructure#4228 See merge request gitlab-org/gitlab-ce!18997
-rw-r--r--config/initializers/deprecations.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/config/initializers/deprecations.rb b/config/initializers/deprecations.rb
index 2476ea9e38a..14616e726d9 100644
--- a/config/initializers/deprecations.rb
+++ b/config/initializers/deprecations.rb
@@ -1,5 +1,9 @@
-deprecator = ActiveSupport::Deprecation.new('11.0', 'GitLab')
+if Rails.env.development? || ENV['GITLAB_LEGACY_PATH_LOG_MESSAGE']
+ deprecator = ActiveSupport::Deprecation.new('11.0', 'GitLab')
+
+ deprecator.behavior = -> (message, callstack) {
+ Rails.logger.warn("#{message}: #{callstack[1..20].join}")
+ }
-if Gitlab.dev_env_or_com?
ActiveSupport::Deprecation.deprecate_methods(Gitlab::GitalyClient::StorageSettings, :legacy_disk_path, deprecator: deprecator)
end