Commit 090cf00c authored by Robert Schmidt's avatar Robert Schmidt

Simplify logging UTC option to only show time

We probably almost never care about the date, but it takes a lot of
space. Remove it; if somebody needs the full time stamp including the
date, we could still add it with a new option.
parent 8186e840
...@@ -575,8 +575,7 @@ static inline int log_header(log_component_t *c, ...@@ -575,8 +575,7 @@ static inline int log_header(log_component_t *c,
struct tm utc_time; struct tm utc_time;
if (gmtime_r(&t.tv_sec, &utc_time) == NULL) if (gmtime_r(&t.tv_sec, &utc_time) == NULL)
abort(); abort();
snprintf(timeString, sizeof(timeString), "%04d-%02d-%02d %02d:%02d:%02d.%06lu UTC ", snprintf(timeString, sizeof(timeString), "[%02d:%02d:%02d.%06lu] ",
utc_time.tm_year + 1900, utc_time.tm_mon + 1, utc_time.tm_mday,
utc_time.tm_hour, utc_time.tm_min, utc_time.tm_sec, t.tv_nsec / 1000); utc_time.tm_hour, utc_time.tm_min, utc_time.tm_sec, t.tv_nsec / 1000);
} else { } else {
snprintf(timeString, sizeof(timeString), "%lu.%06lu ", snprintf(timeString, sizeof(timeString), "%lu.%06lu ",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment