formating cleanup
parent
eddd9e65e2
commit
59f5b82cc9
|
@ -46,19 +46,19 @@ static int log_date_prefix(char * buff, size_t buff_size)
|
|||
|
||||
|
||||
//utility macro to log also with a date as a prefix
|
||||
#define log_with_date(f, ...) do{ \
|
||||
struct tm tm_tmp; \
|
||||
time_t result= time(NULL); \
|
||||
localtime_r(&result, &tm_tmp); \
|
||||
fprintf(f, "%02d%02d%02d %2d:%02d:%02d: ", \
|
||||
tm_tmp.tm_year % 100, \
|
||||
tm_tmp.tm_mon+1, \
|
||||
tm_tmp.tm_mday, \
|
||||
tm_tmp.tm_hour, \
|
||||
tm_tmp.tm_min, \
|
||||
tm_tmp.tm_sec); \
|
||||
fprintf(f, __VA_ARGS__); \
|
||||
}while(0)
|
||||
#define log_with_date(f, ...) do{\
|
||||
struct tm tm_tmp;\
|
||||
time_t result= time(NULL);\
|
||||
localtime_r(&result, &tm_tmp);\
|
||||
fprintf(f, "%02d%02d%02d %2d:%02d:%02d: ",\
|
||||
tm_tmp.tm_year % 100,\
|
||||
tm_tmp.tm_mon+1,\
|
||||
tm_tmp.tm_mday,\
|
||||
tm_tmp.tm_hour,\
|
||||
tm_tmp.tm_min,\
|
||||
tm_tmp.tm_sec);\
|
||||
fprintf(f, __VA_ARGS__);\
|
||||
}while(0)
|
||||
|
||||
|
||||
//initialize static stuff
|
||||
|
@ -391,6 +391,7 @@ ssize_t Audit_json_formatter::event_format(ThdSesData* pThdData, IWriter * write
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
yajl_add_string_val(gen, "cmd", cmd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue