Cleanup
Revert unnecessary changes relative to origin/develop Reviewed with Andrew
This commit is contained in:
+17
-17
@@ -45,6 +45,7 @@
|
||||
#include "common/config/config_userapi.h"
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
// main log variables
|
||||
|
||||
log_mem_cnt_t log_mem_d[2];
|
||||
@@ -477,29 +478,28 @@ char *log_getthreadname(char *threadname,
|
||||
}
|
||||
|
||||
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];
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
struct tm tm;
|
||||
localtime_r(&tv.tv_sec, &tm);
|
||||
|
||||
return snprintf(log_buffer, buffsize, "%02d:%02d:%02d.%06ld %s%s[%s]%c %s %s%s",
|
||||
tm.tm_hour,
|
||||
tm.tm_min,
|
||||
tm.tm_sec,
|
||||
tv.tv_usec,
|
||||
log_level_highlight_end[level],
|
||||
((g_log->flag & FLAG_NOCOLOR) ? "" : log_level_highlight_start[level]),
|
||||
g_log->log_component[comp].name,
|
||||
((g_log->flag & FLAG_LEVEL) ? g_log->level2string[level] : ' '),
|
||||
((g_log->flag & FLAG_THREAD) ? log_getthreadname(threadname, PR_SET_NAME + 1) : ""),
|
||||
format,
|
||||
log_level_highlight_end[level]);
|
||||
return snprintf(log_buffer, buffsize, "%02d:%02d:%02d.%06ld %s%s[%s]%c %s %s%s",
|
||||
tm.tm_hour,
|
||||
tm.tm_min,
|
||||
tm.tm_sec,
|
||||
tv.tv_usec,
|
||||
log_level_highlight_end[level],
|
||||
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
|
||||
g_log->log_component[comp].name,
|
||||
( (g_log->flag & FLAG_LEVEL)?g_log->level2string[level]:' '),
|
||||
( (g_log->flag & FLAG_THREAD)?log_getthreadname(threadname,PR_SET_NAME+1):""),
|
||||
format,
|
||||
log_level_highlight_end[level]);
|
||||
}
|
||||
|
||||
void logRecord_mt(const char *file,
|
||||
|
||||
@@ -106,14 +106,15 @@ extern "C" {
|
||||
#define LOG_ORANGE "\033[93m" /*!< \brief VT100 sequence for orange foreground */
|
||||
#define LOG_BLUE "\033[34m" /*!< \brief VT100 sequence for blue foreground */
|
||||
#define LOG_CYBL "\033[40;36m" /*!< \brief VT100 sequence for cyan foreground on black background */
|
||||
#define LOG_RESET "\033[0m" /*!< \brief VT100 sequence for reset (black) foreground */
|
||||
#else
|
||||
#define LOG_RED ""
|
||||
#define LOG_GREEN ""
|
||||
#define LOG_ORANGE ""
|
||||
#define LOG_BLUE ""
|
||||
#define LOG_CYBL ""
|
||||
#define LOG_RESET ""
|
||||
#endif
|
||||
# define LOG_RED ""
|
||||
# define LOG_GREEN ""
|
||||
# define LOG_ORANGE ""
|
||||
# define LOG_BLUE ""
|
||||
# define LOG_CYBL ""
|
||||
# define LOG_RESET ""
|
||||
#endif // LOG_WITH_COLORS
|
||||
/* @}*/
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user