B
baibaichen
hi
our internal log apis support varargs, but do not support <<, it means
that we have to write funciton tracing like this:
printf("%s(%d,%f)", functionName,iCount,dTime);
this need us write format string mannualy each time.
I think the better style looks like:
#define BetterFunctionTrace ....
BetterFunctionTrace(functioName, iCount,dTime);
Is there any way to generate the format string in the compile time
accroding to parameter type and parameter number? i.e.
function1(int,char*,double) => %s(%d,%s,%f);
function2(int,char*,double,unsigned int) => %s(%d,%s,%f,%u);
any idea?
thanks
our internal log apis support varargs, but do not support <<, it means
that we have to write funciton tracing like this:
printf("%s(%d,%f)", functionName,iCount,dTime);
this need us write format string mannualy each time.
I think the better style looks like:
#define BetterFunctionTrace ....
BetterFunctionTrace(functioName, iCount,dTime);
Is there any way to generate the format string in the compile time
accroding to parameter type and parameter number? i.e.
function1(int,char*,double) => %s(%d,%s,%f);
function2(int,char*,double,unsigned int) => %s(%d,%s,%f,%u);
any idea?
thanks