代码拉取完成,页面将自动刷新
目前在做一个项目log输出里有一些业务数据信息相关的业务,因此需要日志输出时间精确到毫秒级别,目前我在项目暂时处理,在lib_acl/src/stdlib/acl_mylog.c文件中,将acl_logtime_fmt函数实现调整为:
void acl_logtime_fmt(char *buf, size_t size)
{
//time_t now;
struct timeval tm0;
gettimeofday(&tm0, NULL);
time_t now = tm0.tv_sec;
#ifdef ACL_UNIX
struct tm local_time;
//(void) time (&now);
(void) localtime_r(&now, &local_time);
strftime(buf, size, "%Y/%m/%d %H:%M:%S", &local_time);
sprintf(buf, "%s.%03d ", buf,(int)(tm0.tv_usec/1000));
#elif defined(ACL_WINDOWS)
struct tm *local_time;
//(void) time (&now);
local_time = localtime(&now);
strftime(buf, size, "%Y/%m/%d %H:%M:%S", local_time);
sprintf(buf, "%s.%03d ",buf, (int)(tm0.tv_usec/1000));
#else
# error "unknown OS type"
#endif
}
后期新版本如果许可,是否可以在日志模块增加毫秒级别时间格式的选择呢