打印日志自动带文件名、所在行、函数名
//打印
#define LOG_INFO(x) PrintLOG(x,__FILE__,__LINE__)
printf("File Fame: %s\n", __FILE__); //文件名
printf("Present Line: %d\n", __LINE__); //所在行
printf("Present Function: %s\n", __func__); //函数名
//打印日志
#define UAS_LOG1(logEvent,...) \
do{ \
time_t t = time(0);\
char tmp[64];\
strftime( tmp, sizeof(tmp), "%Y/%m/%d %X ",localtime(&t) );\
std::string fileName=__FILE__; \
if (!fileName.empty()) {\
int pos = fileName.find_last_of('/');\
fileName = fileName.substr(pos + 1);\
}\
printf("%s%s:%d "#logEvent"\n",tmp,__FILE__,__LINE__,##__VA_ARGS__);\
}while(0)\