Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#128 Add deprecated warning helper function #12040

Closed
wants to merge 1 commit into from

Conversation

mattwire
Copy link
Contributor

@mattwire mattwire commented Apr 28, 2018

Overview

This adds a standard method to log a deprecated function warning.

Before

Deprecated function warnings were inconsistent and you have to put too much detail in the log line.

After

One simple function that autogenerates the log message based on caller.

Comments from previous PR #12007

@totten:

I think @totten tried to enhance deprecated output at some point

Probably this: https://chat.civicrm.org/civicrm/pl/cf1p7hgkkprp9kthkosq98qrer

@mattwire

A standalone helper function is more pithy than the Civi::log...civi.tag=>deprecated.... Pithy is good.
From r-code perspective, I don't like having that helper in CRM_Utils_System. That class is too heavy already, and deprecatedFunctionWarning() is qualitatively different from every other function in the class.

Yes, I agree. I wasn't sure where to "dump" the function. Maybe CRM/Core/Error/Log.php would be a better place for it?

My main hesitation with cf1p7hgkkprp9kthkosq98qrer was that findNonLogCaller() felt a little heavy-handed. It's nice how deprecatedFunctionWarning() doesn't have to dig as far back into the callstack.
On the other hand, it's nice how cf1p7hgkkprp9kthkosq98qrer works with the existing coding convention.

We don't actually log deprecated very much so I don't think it's a big change to convention.

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@mattwire mattwire changed the title WIP Add deprecated function warning function (WIP) dev/core#128 Add deprecated function warning function May 18, 2018
@mattwire
Copy link
Contributor Author

@mattwire mattwire closed this May 18, 2018
@mattwire mattwire changed the title (WIP) dev/core#128 Add deprecated function warning function dev/core#128 Add deprecated warning helper function May 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants