ca_replace_printf_handler should supply a user private pointer

Bug #541271 reported by Jeff Hill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Won't Fix
Wishlist
mdavidsaver

Bug Description

ca_replace_printf_handler should supply a user private pointer so that the user has access to a ca context private data structure

Original Mantis Bug: mantis-236
    http://www.aps.anl.gov/epics/mantis/view_bug_page.php?f_id=236

Tags: ca
Revision history for this message
evans (evans) wrote :

I notice on browsing CA that the function that gets redirected by
ca_replace_printf_handler is little used. The default is
errlogVprintf. However, it is much more common to use errlogVPrintf
or errlogPrintf directly, which does not get redirected. It would
seem good to make a more consistent policy, perhaps eliminating it
entirely.

BTW I notice the CTOR for ca_client_context initializes pVPrintFunc to
errlogVprintf, whereas ca_replace_printf_handler (actually
ca_client_context::replaceErrlogHandler) sets it to epicsVprintf if
the incoming argument is NULL. They are the same via errlog.h.
Following this sort of spaghetti is tedious when you are trying to
trace code. It could all be cleaned up.

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

It's probably not work changing the API at this point. The same effect can be achieved with a thread local variable in the same way that the CAC context is managed.

Changed in epics-base:
status: New → Won't Fix
assignee: nobody → mdavidsaver (mdavidsaver)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.