diff --git a/embed/web-process-extension/ephy-web-process-extension-main.c b/embed/web-process-extension/ephy-web-process-extension-main.c index 457ff8964e7e7f8274b1cc827d1c0ee17b09e1fc..f109fee131d9853d1485c998d7a545429baf494c 100644 --- a/embed/web-process-extension/ephy-web-process-extension-main.c +++ b/embed/web-process-extension/ephy-web-process-extension-main.c @@ -43,7 +43,7 @@ webkit_web_process_extension_initialize_with_user_data (WebKitWebProcessExtensio gboolean is_webextension; g_autoptr (GError) error = NULL; - g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL); + ephy_debug_set_fatal_criticals (); g_variant_get (user_data, "(&sm&sbbb&s)", &guid, &profile_dir, &should_remember_passwords, &private_profile, &is_webextension, &webextension_translations); diff --git a/lib/ephy-debug.c b/lib/ephy-debug.c index f4c63bbd723321e334ec54b4ddff8bbc449aca61..743a7a530affb5823c76b9bff1221f8316484441 100644 --- a/lib/ephy-debug.c +++ b/lib/ephy-debug.c @@ -204,6 +204,18 @@ ephy_profiler_free (EphyProfiler *profiler) g_free (profiler); } +/** + * ephy_debug_set_fatal_critcals: + * + * Sets criticals to fatal unless otherwise specified by `G_DEBUG`. + **/ +void +ephy_debug_set_fatal_criticals () +{ + if (!g_getenv ("G_DEBUG")) + g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL); +} + /** * ephy_profiler_start: * @name: name of this new profiler diff --git a/lib/ephy-debug.h b/lib/ephy-debug.h index d4feddc3bebc44439de8ee36139e7c9323fec203..9ab057b41c892065ee559043661b8b7e9fad782b 100644 --- a/lib/ephy-debug.h +++ b/lib/ephy-debug.h @@ -45,4 +45,6 @@ void ephy_profiler_start (const char *name, void ephy_profiler_stop (const char *name); +void ephy_debug_set_fatal_criticals (); + G_END_DECLS diff --git a/src/ephy-main.c b/src/ephy-main.c index a627833a050dc8b380fae9449fbd94d438f41967..02283b5281d0e9e1f694c128c509134f14add186 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -217,7 +217,7 @@ main (int argc, */ LIBXML_TEST_VERSION; - g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL); + ephy_debug_set_fatal_criticals (); /* If we're given -remote arguments, translate them */ if (argc >= 2 && strcmp (argv[1], "-remote") == 0) {