void _log(const int level, char* file, int line, const char* fmt, ...){ va_list ap; int count; time_t t; struct tm* st; char str_time[255]; memset(str_time, 0x00, sizeof(str_time)); time(&t); st= localtime(&t); switch(level){ case DEBUG: fprintf(stdout, "[DEBUG] "); break; case INFO: fprintf(stdout, "[INFO] "); break; case WARNING: fprintf(stdout, "[WARNING] "); break; case ERROR: fprintf(stdout, "[ERROR] "); break; default: fprintf(stdout, "[INFO] "); break; } strftime( str_time, sizeof(str_time), "%Y-%m-%d %H:%M:%S", st); fprintf(stdout, "[%s] LINE:[%04d] [%s] ", file, line, str_time); va_start(ap, fmt); count = vfprintf(stdout, fmt, ap); fprintf(stdout, "\n"); fflush(stdout); va_end(ap); }#define log_info(...) _log((INFO), (__FILE__), (__LINE__), "", (#__VA_ARGS__))#define log_err(...) _log((ERROR), (__FILE__), (__LINE__), "", (#__VA_ARGS__))
Syntax error at line 71, column 18, file RProCrminfo.cp:
Error at line 71, column 18 in file RProCrminfo.cp
define log_info((aaa), ...) _log((INFO), (__FILE__), (__LINE__), "", (#__VA_ARG
S__))
.................1
PCC-S-02014, Encountered the symbol "(" when expecting one of the following:
) ... an identifier, define, elif, else, endif, error, if,
ifdef, ifndef, include, line, pragma, undef, exec, sql,
begin, end, var, type, oracle,
an immediate preprocessor command, a C token, create,
function, package, procedure, trigger, or, replace,
The symbol ")" was substituted for "(" to continue.
婷婷同学_
相关分类