static void debug_setup_1(char *config, char *subdir);
static void debug_setup_2(char *s, int fd, char *annotation);
static char *msg_timestamp(void);
+static char *msg_thread(void);
static void debug_logging_handler(const gchar *log_domain,
GLogLevelFlags log_level,
return timestamp;
}
+/* Get current GMT time and return a message timestamp.
+ * Used for g_printf calls to logs and such. The return value
+ * is to a static buffer, so it should be used immediately.
+ *
+ * @returns: timestamp
+ */
+static char *
+msg_thread(void)
+{
+ static char thread[128];
+
+ sprintf(thread, "thd-%p", g_thread_self());
+
+ return thread;
+}
+
/*
* ---- public functions
*/
char *text;
if (db_file != stderr)
- prefix = g_strdup_printf("%s: %s:", msg_timestamp(), get_pname());
+ prefix = g_strdup_printf("%s: %s: %s:", msg_timestamp(), msg_thread(), get_pname());
else
prefix = g_strdup_printf("%s:", get_pname());
arglist_start(argp, format);