Discussion: function trace
Afficher un message
Vieux 16/10/2007, 07h24   #1
baibaichen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut function trace

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

  Réponse avec citation
 
Page generated in 0,04592 seconds with 9 queries