I have multiple uses of one type of debug statement in my code - say DEBUG("abcd");
or DEBUG("abc %d def", val)
which get translated and printed to a file.
Now, however I want to convert them all to a different type of logging which requires using a function with declaration like -
WRITE(char *string);
Usage: WRITE(L"abcd")
etc..
Because the usage of this debug statement is huge, I am hoping to use macros to convert the same. Can this be done; also given that the DEBUG
function used to take in format specifiers too?
Maybe you're looking at :
#define DEBUG(str,...) WRITE(str,__VA_ARGS__)