static void log_to_debugger (EmpathyDebugFlags flag, const gchar *message) { EmpathyDebugger *dbg = empathy_debugger_get_singleton (); gchar *domain; GTimeVal now; g_get_current_time (&now); domain = g_strdup_printf ("%s/%s", G_LOG_DOMAIN, debug_flag_to_key (flag)); empathy_debugger_add_message (dbg, &now, domain, G_LOG_LEVEL_DEBUG, message); g_free (domain); }
static void default_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) { g_log_default_handler (log_domain, log_level, message, NULL); /* G_LOG_DOMAIN = "empathy". No need to send empathy messages to the * debugger as they already have in empathy_debug. */ if (log_level != G_LOG_LEVEL_DEBUG || tp_strdiff (log_domain, G_LOG_DOMAIN)) { EmpathyDebugger *dbg; GTimeVal now; dbg = empathy_debugger_get_singleton (); g_get_current_time (&now); empathy_debugger_add_message (dbg, &now, log_domain, log_level, message); } }