Forum OpenACS Development: Issuing a warning for deprecated procs

I couldn't get ad_proc to issue a warning for procs that use the deprecated and warn flags so I added the statement:

ns_log Warning "procedure $proc_name has been deprecated and will probably be removed eventually. Please use an alternative non-deprecated procedure instead"

The message is maybe a little over-verbose, but it is a lot better than no message at all I think.

What is the policy on when to use the warn flag? I would have thought that we always wanted to warn about the use of deprecated procs?

/Peter

Collapse
Posted by Jeff Davis on
I think we should not warn on all deprecated procs if only because there are so many that are still used *a lot* like ad_get_user_id (deprecated in favour of [ad_conn user_id] and the logs would be huge. I do think we should warn on procs where we really intend to remove them in the next version and have made an effort to change the existing code to use the new proc.

An example of a deprecated proc where nobody's made the effort to move to the new proc is ad_permission_p (deprecated in favor of permission::get). I guess it's a seperate question whether we should deprecate procs unless we also make the effort to actually get rid of them in the code.

I would change the message to:

ns_log Debug "Deprecated proc $proc_name used"
Since it is less annoyingly long and also is Debug so isn't displayed on a production box.
Collapse
Posted by Don Baccus on
I would vote no for now, too - maybe put them out at the "debug" rather than "warn" level?

I would like to see us put together a push to get rid of these deprecated procs for an upcoming release, but I don't see it as passing the triage test for 4.7.  Maybe 4.8?

What we need are one or two knowledgable volunteers willing to grunt their way through the code removing references.

Collapse
Posted by Peter Marklund on
I added the debug level log statement for deprecated procs like Jeff recommended.

Don - removing a bunch of deprecated procs for 4.8 sounds like a good idea to me. That also means we should make sure that for 4.7 all procs that should be deprecated really are, so that people have some time to shift over to using newer procs.