diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-17 18:53:06 +0000 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-05-17 14:56:34 -0500 |
commit | cc4f7ef41c65d4a3ac84b91c652fe4b49bfff493 (patch) | |
tree | 850a3ab362db6cf76db6b6574488dd1f0eb3a961 | |
parent | b605916fe75650b73fa11f68c9434bb00229e88c (diff) | |
download | gitlab-ce-cc4f7ef41c65d4a3ac84b91c652fe4b49bfff493.tar.gz |
Merge branch 'sh-remove-deprecation-warnings-from-com' into 'master'
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 |