Commit b8fa968b authored by Jehan's avatar Jehan

app: add backtraces on warning messages in GIMP_UNSTABLE.

parent b318694b
......@@ -131,6 +131,9 @@ errors_init (Gimp *gimp,
for (i = 0; i < G_N_ELEMENTS (log_domains); i++)
g_log_set_handler (log_domains[i],
#ifdef GIMP_UNSTABLE
G_LOG_LEVEL_WARNING |
#endif
G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_CRITICAL,
gimp_message_log_func, gimp);
......@@ -206,9 +209,11 @@ gimp_message_log_func (const gchar *log_domain,
"generate-backtrace", &generate_backtrace,
NULL);
if (generate_backtrace && (flags & G_LOG_LEVEL_CRITICAL))
if (generate_backtrace &&
(flags & (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING)))
{
severity = GIMP_MESSAGE_ERROR;
severity = (flags & G_LOG_LEVEL_CRITICAL) ?
GIMP_MESSAGE_ERROR : GIMP_MESSAGE_WARNING;
if (n_traces < MAX_TRACES)
{
......
......@@ -356,17 +356,17 @@ gimp_critical_dialog_new (const gchar *title)
}
void
gimp_critical_dialog_add (GtkWidget *dialog,
const gchar *message,
const gchar *trace,
gboolean is_fatal,
const gchar *program,
gint pid)
gimp_critical_dialog_add (GtkWidget *dialog,
const gchar *message,
const gchar *trace,
gboolean is_fatal,
const gchar *program,
gint pid)
{
GimpCriticalDialog *critical;
GtkTextBuffer *buffer;
GtkTextIter end;
gchar *text;
GtkTextBuffer *buffer;
GtkTextIter end;
gchar *text;
if (! GIMP_IS_CRITICAL_DIALOG (dialog) || ! message || ! trace)
{
......@@ -389,8 +389,8 @@ gimp_critical_dialog_add (GtkWidget *dialog,
else if (! gtk_label_get_text (GTK_LABEL (critical->label)) ||
strlen (gtk_label_get_text (GTK_LABEL (critical->label))) == 0)
{
/* First critical error. Let's just display it. */
text = g_strdup_printf (_("GIMP encountered a critical error: %s"),
/* First error. Let's just display it. */
text = g_strdup_printf (_("GIMP encountered an error: %s"),
message);
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment