Cleanup before merge
The clean up includes removing white space changes, adding logs, adding comments to make various changes more obvious, etc.
This commit is contained in:
+22
-22
@@ -523,12 +523,12 @@ void logMinimal(int comp, int level, const char *format, ...)
|
||||
#endif // LOG_MINIMAL
|
||||
|
||||
static int log_header(char *log_buffer,
|
||||
int buffsize,
|
||||
int comp,
|
||||
int level,
|
||||
const char *format)
|
||||
int buffsize,
|
||||
int comp,
|
||||
int level,
|
||||
const char *format)
|
||||
{
|
||||
char threadname[PR_SET_NAME];
|
||||
char threadname[PR_SET_NAME];
|
||||
struct timespec ts;
|
||||
if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
|
||||
abort();
|
||||
@@ -545,24 +545,24 @@ static int log_header(char *log_buffer,
|
||||
}
|
||||
|
||||
void logRecord_mt(const char *file,
|
||||
const char *func,
|
||||
int line,
|
||||
int comp,
|
||||
int level,
|
||||
const char *format,
|
||||
... )
|
||||
const char *func,
|
||||
int line,
|
||||
int comp,
|
||||
int level,
|
||||
const char *format,
|
||||
... )
|
||||
{
|
||||
char log_buffer[MAX_LOG_TOTAL]= {0};
|
||||
va_list args;
|
||||
va_start(args,format);
|
||||
if (log_mem_flag == 1) {
|
||||
log_output_memory(file,func,line,comp,level,format,args);
|
||||
} else {
|
||||
log_header(log_buffer,MAX_LOG_TOTAL,comp,level,format);
|
||||
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer,args);
|
||||
fflush(g_log->log_component[comp].stream);
|
||||
}
|
||||
va_end(args);
|
||||
char log_buffer[MAX_LOG_TOTAL]= {0};
|
||||
va_list args;
|
||||
va_start(args,format);
|
||||
if (log_mem_flag == 1) {
|
||||
log_output_memory(file,func,line,comp,level,format,args);
|
||||
} else {
|
||||
log_header(log_buffer,MAX_LOG_TOTAL,comp,level,format);
|
||||
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer,args);
|
||||
fflush(g_log->log_component[comp].stream);
|
||||
}
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void vlogRecord_mt(const char *file,
|
||||
|
||||
@@ -425,6 +425,8 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
/* bitmask dependent macros, to generate debug file such as matlab file or message dump */
|
||||
# define LOG_DUMPFLAG(D) (g_log->dump_mask & D)
|
||||
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)/* */
|
||||
/* define variable only used in LOG macro's */
|
||||
# define LOG_VAR(A,B) A B
|
||||
# else /* T_TRACER: remove all debugging and tracing messages, except errors */
|
||||
# define LOG_I(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ; } while(0)/* */
|
||||
# define LOG_W(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ; } while(0)/* */
|
||||
@@ -438,6 +440,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
# define LOG_DEBUGFLAG(D) ( 0 )
|
||||
# define LOG_DUMPFLAG(D) ( 0 )
|
||||
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)
|
||||
# define LOG_VAR(A,B)
|
||||
# endif /* T_TRACER */
|
||||
#endif // LOG_MINIMAL
|
||||
|
||||
|
||||
@@ -569,7 +569,6 @@ int signal_handle(int *end);
|
||||
int signal_mask(void);
|
||||
|
||||
void log_scheduler(const char *label);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user