From 1c866622d5e22918d1228d4ad2be0e53233c6255 Mon Sep 17 00:00:00 2001 From: LittleTux89 <41306939+LittleTux89@users.noreply.github.com> Date: Wed, 20 Feb 2019 09:23:49 +0300 Subject: [PATCH] [*] Timestamp display is enabled when logging events. (#39) --- core/dap_common.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/core/dap_common.c b/core/dap_common.c index 3751e06..5015739 100644 --- a/core/dap_common.c +++ b/core/dap_common.c @@ -167,15 +167,13 @@ void _vlog_it(const char * log_tag,enum log_level ll, const char * format,va_lis va_copy(ap2,ap); - if (s_log_file){ - time_t t=time(NULL); - struct tm* tmp=localtime(&t); - static char s_time[1024]={0}; - strftime(s_time,sizeof(s_time),"%x-%X",tmp); - - if (s_log_file ) fprintf(s_log_file,"[%s] ",s_time); - printf("[%s] ",s_time); - } + time_t t=time(NULL); + struct tm* tmp=localtime(&t); + static char s_time[1024]={0}; + strftime(s_time,sizeof(s_time),"%x-%X",tmp); + + if (s_log_file ) fprintf(s_log_file,"[%s] ",s_time); + printf("[%s] ",s_time); if(ll==L_DEBUG){ if (s_log_file ) fprintf(s_log_file,"[DBG] "); -- GitLab