I have a few trace lines in my file of the form
M_TRACE(EV_TRACE_LEVEL_DEBUG, "some trace");
I want to convert those into
M_TRACE(EV_TRACE_LEVEL_DEBUG, "%s: some trace", __FUNCTION__);
However I have already a few traces which display the function name also.
To make the conversion i am using the following command
:%g/M_TRACE/s/"\(.*\)"/"%s: \1", __FUNCTION__/c
which unfortunately includes a redundant FUNCTION in some places.
Is there any better way to do this?
You can do this in a single command:
It will replace the “,
__FUNCTION__” if its already present or it simply append it if its not present.