[Github-comments] [geany/geany] Null time on debug messages (Issue #3071)

Robert Di Pardo notifications at xxxxx
Wed Dec 29 08:43:03 UTC 2021


> . . . only latest Glibses support it.

The minimum required version is 2.65.2: https://github.com/frida/glib/blob/6fd4f36bac4d3f9c7ddc809bad6d04bd3365f39b/NEWS#L1002

> @eht16 its your change, do you want to revert it or can you somehow test its availability in the runtime Glib?

I'm probably oversimplifying the issue, but it seems a tiny patch like this would do the job:

```diff
diff --git a/src/utils.c b/src/utils.c
index 6f7cb5b0..8283692a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -60,6 +60,11 @@
 #include <glib/gstdio.h>
 #include <gio/gio.h>
 
+#if GLIB_MAJOR_VERSION >= 0x2 && GLIB_MINOR_VERSION >= 0x41 && GLIB_MICRO_VERSION >= 0x2
+#define G_TIME_FMT_MICRO "%H:%M:%S.%f"
+#else
+#define G_TIME_FMT_MICRO "%H:%M:%S"
+#endif
 
 /**
  *  Tries to open the given URI in a browser.
@@ -1050,7 +1055,7 @@ gint utils_parse_color_to_bgr(const gchar *spec)
 gchar *utils_get_current_time_string(gboolean include_microseconds)
 {
 	GDateTime *now = g_date_time_new_now_local();
-	const gchar *format = include_microseconds ? "%H:%M:%S.%f" : "%H:%M:%S";
+	const gchar *format = include_microseconds ? G_TIME_FMT_MICRO : "%H:%M:%S";
 	gchar *time_string = g_date_time_format(now, format);
 	g_date_time_unref(now);
 	return time_string;
```

![Screenshot_2021-12-29_03-19-34](https://user-images.githubusercontent.com/59004801/147641919-161b10ed-7531-4765-9815-cd8a961ccb49.png)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3071#issuecomment-1002462728
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/3071/1002462728 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211229/53ee8442/attachment-0001.htm>


More information about the Github-comments mailing list