Conditionally enable deprecation log messages
These warnings are filling up disks on GitLab.com, so we need to remove them.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/46158, https://gitlab.com/gitlab-com/infrastructure/issues/4228
Edited by Stan Hu