I need to have function name. I have done two procedures to print it’s name:
Using macro:
define LogFnc(info) do {cout<<"=FUNCTION= "<info ; } while(0)
and using function:
void LogFnc(string info)
{
cout<<"=FUNCTION= "<<info;
}
Procedure that calls one of those possibilities:
int main() {
LogFnc(__FUNCTION__);
}
Why in case I use macro (firs one) no function name is printed?
you forgot one bracket in cout<<“=FUNCTION= ” << info
Let me say moreover that your false loop
do{...}while(0)is ugly, non intuitive, and counter-productive.