diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-17 18:53:06 +0000 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-17 13:56:03 -0500 |
commit | 9446d49aae19c2416fd152399b7e4efa3c6cbfc2 (patch) | |
tree | a15f56a77731f265615dfe800cfab5015996f4f4 | |
parent | 48d54c52f745e44b24cd6590abacb6496cb026c6 (diff) | |
download | gitlab-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.rb | 8 |
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 |