Skip to content

Commit e6db317

Browse files
committed
debug: don't use %f for time format
It is not supported on older platforms, like CentOS7.
1 parent bb5dfa1 commit e6db317

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/arvdebug.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,17 @@ arv_debug_with_level (ArvDebugCategory category, ArvDebugLevel level, const char
150150
return;
151151

152152
date = g_date_time_new_now_local ();
153-
time_str = g_date_time_format (date, "%H:%M:%S.%f");
153+
time_str = g_date_time_format (date, "%H:%M:%S");
154154

155155
if (stderr_has_color_support ())
156-
header = g_strdup_printf ("[\033[34m%.12s\033[0m] %s%s%s\033[0m> ",
157-
time_str,
156+
header = g_strdup_printf ("[\033[34m%s.%03d\033[0m] %s%s%s\033[0m> ",
157+
time_str, g_date_time_get_microsecond (date) / 1000,
158158
arv_debug_level_infos[level].color,
159159
arv_debug_level_infos[level].symbol,
160160
arv_debug_category_infos[category].name);
161161
else
162-
header = g_strdup_printf ("[%.12s] %s%s> ",
163-
time_str,
162+
header = g_strdup_printf ("[%s.%03d] %s%s> ",
163+
time_str, g_date_time_get_microsecond (date) / 1000,
164164
arv_debug_level_infos[level].symbol,
165165
arv_debug_category_infos[category].name);
166166

0 commit comments

Comments
 (0)