[gnome-builder] support: track application startup time in support log
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] support: track application startup time in support log
- Date: Sat, 9 May 2015 20:33:44 +0000 (UTC)
commit 33c51fedbbd37e3f76ec2499fa0fa4a3e958c191
Author: Christian Hergert <christian hergert me>
Date: Sat May 9 13:32:44 2015 -0700
support: track application startup time in support log
Since we removed the date from the logs, it is helpful to have an idea of
how long the application has been running.
src/support/gb-support.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/support/gb-support.c b/src/support/gb-support.c
index 98150c0..42d0da8 100644
--- a/src/support/gb-support.c
+++ b/src/support/gb-support.c
@@ -19,19 +19,24 @@
#include <gtk/gtk.h>
#include <string.h>
+#include "gb-application.h"
#include "gb-support.h"
gchar *
gb_get_support_log (void)
{
+ GApplication *app;
GChecksum *checksum;
GDateTime *now;
+ GDateTime *started_at;
GString *str;
gchar *tmp;
gchar **env;
guint i;
guint n_monitors;
+ app = g_application_get_default ();
+
str = g_string_new (NULL);
/*
@@ -51,11 +56,18 @@ gb_get_support_log (void)
tmp = g_get_current_dir ();
g_string_append_printf (str, "current_dir = \"%s\"\n", tmp);
g_free (tmp);
+
+ started_at = gb_application_get_started_at (GB_APPLICATION (app));
+ tmp = g_date_time_format (started_at, "%FT%H:%M:%SZ");
+ g_string_append_printf (str, "started-at = \"%s\"\n", tmp);
+ g_free (tmp);
+
now = g_date_time_new_now_utc ();
tmp = g_date_time_format (now, "%FT%H:%M:%SZ");
g_string_append_printf (str, "generated-at = \"%s\"\n", tmp);
g_free (tmp);
g_date_time_unref (now);
+
g_string_append (str, "\n");
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]