From 5369e7d7a5d5d445e39bdc193ea2551dedbb05b1 Mon Sep 17 00:00:00 2001 From: wangyu Date: Fri, 28 Jul 2017 23:24:49 +0800 Subject: [PATCH] fixe log color bug --- log.h | 2 +- main.cpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/log.h b/log.h index 2cc03cc..6b85044 100755 --- a/log.h +++ b/log.h @@ -76,7 +76,7 @@ const int log_trace=6; const int log_end=7; const char log_text[][20]={"NEVER","FATAL","ERROR","WARN","INFO","DEBUG","TRACE",""}; -const char log_color[][20]={RED,RED,RED,YEL,GRN,BLU,""}; +const char log_color[][20]={RED,RED,RED,YEL,GRN,MAG,""}; extern int log_level; extern int enable_log_position; diff --git a/main.cpp b/main.cpp index ece220e..790b2eb 100755 --- a/main.cpp +++ b/main.cpp @@ -564,6 +564,8 @@ struct conn_info_t struct conn_manager_t { unordered_map mp; + unordered_map const_id_mp; + unordered_map::iterator it; unordered_map::iterator clear_it; unordered_map::iterator old_it; @@ -3196,6 +3198,8 @@ int server_on_raw_recv_multi() mylog(log_info,"received handshake %x %x\n",conn_info.oppsite_id,conn_info.my_id); + //conn_manager.const_id_mp= + conn_info.server_current_state=server_ready; //conn_info.last_state_time=get_current_time(); //dont change this @@ -3799,6 +3803,8 @@ int server_event_loop() //printf("%d %d %d %d\n",timer_fd,raw_recv_fd,raw_send_fd,n); if ((events[n].data.u64 ) == timer_fd) { + uint64_t dummy; + read(timer_fd, &dummy, 8); conn_manager.clean_inactive(); } if ((events[n].data.u64 >>32u) == 2u) @@ -4000,6 +4006,10 @@ void process_arg(int argc, char *argv[]) } } } + if(strcmp(argv[i],"--disable-color")==0) + { + enable_log_color=0; + } } mylog(log_info,"argc=%d ", argc); @@ -4134,7 +4144,7 @@ void process_arg(int argc, char *argv[]) } else if(strcmp(long_options[option_index].name,"disable-color")==0) { - enable_log_color=0; + //enable_log_color=0; } else if(strcmp(long_options[option_index].name,"log-position")==0) {