mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 06:19:31 +08:00
fixe log color bug
This commit is contained in:
parent
18f1d995f8
commit
5369e7d7a5
2
log.h
2
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;
|
||||
|
12
main.cpp
12
main.cpp
@ -564,6 +564,8 @@ struct conn_info_t
|
||||
struct conn_manager_t
|
||||
{
|
||||
unordered_map<uint64_t,conn_info_t> mp;
|
||||
unordered_map<uint32_t,uint64_t> const_id_mp;
|
||||
|
||||
unordered_map<uint64_t,conn_info_t>::iterator it;
|
||||
unordered_map<uint64_t,conn_info_t>::iterator clear_it;
|
||||
unordered_map<uint64_t,conn_info_t>::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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user