I just encountered a DEBUG macro in C that I really like
#ifdef DEBUG_BUILD # define DEBUG(x) fprintf(stderr, x) #else # define DEBUG(x) do {} while (0) #e
I use following micro,
#if DEBUG #define LOGE2(x,y) std::cout << "ERRO : " << "[" << __FILE__ << "][" << __FUNCTION__ << "][Line " << __LINE__ << "] " << x <<":"<< y <
USE:
LOGE("ERROR."); LOGE2("ERROR1","ERROR2");