log macro to print file name and line number

This commit is contained in:
wangyu
2017-07-25 00:04:49 +08:00
committed by wangyu
parent 3e50007667
commit 966ec3c925
4 changed files with 30 additions and 14 deletions

4
log.h
View File

@@ -73,9 +73,9 @@ const int log_debug=4;
const int log_trace=5;
#define log(...) log0(__FILE__,__FUNCTION__,__LINE__,__VA_ARGS__)
void log(int level,const char* str, ...);
void log0(const char * file,const char * function,int line,int level,const char* str, ...);
#endif