app, libgimp: add log handlers for all LibGimp* log domains

Looks like they were forgotten so messages from libs went to stdout
instead of being routed through the log handlers, which would show
them in a dialog, or in the error console.
This commit is contained in:
Michael Natterer 2015-05-20 11:05:45 +02:00
parent 4c55f45552
commit 5e591eb232
2 changed files with 34 additions and 9 deletions

View file

@ -86,8 +86,10 @@ errors_init (Gimp *gimp,
"Gimp-Dialogs", "Gimp-Dialogs",
"Gimp-Display", "Gimp-Display",
"Gimp-File", "Gimp-File",
"Gimp-GEGL",
"Gimp-GUI", "Gimp-GUI",
"Gimp-Menus", "Gimp-Menus",
"Gimp-Operations",
"Gimp-PDB", "Gimp-PDB",
"Gimp-Paint", "Gimp-Paint",
"Gimp-Paint-Funcs", "Gimp-Paint-Funcs",
@ -96,7 +98,14 @@ errors_init (Gimp *gimp,
"Gimp-Tools", "Gimp-Tools",
"Gimp-Vectors", "Gimp-Vectors",
"Gimp-Widgets", "Gimp-Widgets",
"Gimp-XCF" "Gimp-XCF",
"LibGimpBase",
"LibGimpColor",
"LibGimpConfig",
"LibGimpMath",
"LibGimpModule",
"LibGimpThumb",
"LibGimpWidgets"
}; };
gint i; gint i;

View file

@ -491,15 +491,31 @@ gimp_main (const GimpPlugInInfo *info,
/* set handler both for the "LibGimp" and "" domains */ /* set handler both for the "LibGimp" and "" domains */
{
const gchar * const log_domains[] =
{
"LibGimp",
"LibGimpBase",
"LibGimpColor",
"LibGimpConfig",
"LibGimpMath",
"LibGimpModule",
"LibGimpThumb",
"LibGimpWidgets"
};
gint i;
g_log_set_handler (G_LOG_DOMAIN, for (i = 0; i < G_N_ELEMENTS (log_domains); i++)
g_log_set_handler (log_domains[i],
G_LOG_LEVEL_MESSAGE, G_LOG_LEVEL_MESSAGE,
gimp_message_func, gimp_message_func,
NULL); NULL);
g_log_set_handler (NULL, g_log_set_handler (NULL,
G_LOG_LEVEL_MESSAGE, G_LOG_LEVEL_MESSAGE,
gimp_message_func, gimp_message_func,
NULL); NULL);
}
if (gimp_debug_flags & GIMP_DEBUG_FATAL_WARNINGS) if (gimp_debug_flags & GIMP_DEBUG_FATAL_WARNINGS)
{ {