From e9bf200468058efeeb7ed35913278bf8763ec070 Mon Sep 17 00:00:00 2001 From: David King Date: Thu, 4 May 2023 12:27:52 +0100 Subject: [PATCH] Quiet dconf logging (#2154269) Resolves: #2154269 --- ...-terminal-3.28.3-quiet-dconf-logging.patch | 70 +++++++++++++++++++ gnome-terminal.spec | 9 ++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 gnome-terminal-3.28.3-quiet-dconf-logging.patch diff --git a/gnome-terminal-3.28.3-quiet-dconf-logging.patch b/gnome-terminal-3.28.3-quiet-dconf-logging.patch new file mode 100644 index 0000000..23d6dad --- /dev/null +++ b/gnome-terminal-3.28.3-quiet-dconf-logging.patch @@ -0,0 +1,70 @@ +From 8b0d3a904e512977383954fc5c1aed20092145eb Mon Sep 17 00:00:00 2001 +From: Christian Persch +Date: Thu, 9 Apr 2020 21:04:32 +0200 +Subject: [PATCH] client: legacy: Suppress debug message spam + +The glib log writer API has a deficiency in that the filtering is +done in the default log writer, instead of only passing messages +that pass the filter. This is filed as glib#2087, but until that +is fixed, apply a simple log level filter to work around it. + +Patch by Kim Nguyen + +Fixes: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/42 +--- + src/terminal-options.c | 26 +++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +diff --git a/src/terminal-options.c b/src/terminal-options.c +index 8d506d82..fe3cad92 100644 +--- a/src/terminal-options.c ++++ b/src/terminal-options.c +@@ -63,10 +63,33 @@ terminal_fprintf (FILE* fp, + } + + #if GLIB_CHECK_VERSION (2, 50, 0) ++static TerminalVerbosity ++verbosity_from_log_level (GLogLevelFlags log_level) ++{ ++ guint level = log_level & G_LOG_LEVEL_MASK; ++ TerminalVerbosity res; ++ level = level & ~(level - 1); /* extract the highest bit */ ++ switch (level) { ++ case G_LOG_LEVEL_DEBUG: ++ res = TERMINAL_VERBOSITY_DEBUG; ++ break; ++ case G_LOG_LEVEL_INFO: ++ res = TERMINAL_VERBOSITY_DETAIL; ++ break; ++ default: ++ /* better display than lose important messages */ ++ res = TERMINAL_VERBOSITY_NORMAL; ++ } ++ return res; ++} + + /* Need to install a special log writer so we never output + * anything without the '# ' prepended, in case --print-environment + * is used. ++ * ++ * FIXME: Until issue glib#2087 is fixed, apply a simple log level filter ++ * to prevent spamming dconf (and other) debug messages to stderr, ++ * see issue gnome-terminal#42. + */ + GLogWriterOutput + terminal_log_writer (GLogLevelFlags log_level, +@@ -74,9 +97,10 @@ terminal_log_writer (GLogLevelFlags log_level, + gsize n_fields, + gpointer user_data) + { ++ TerminalVerbosity level = verbosity_from_log_level(log_level); + for (gsize i = 0; i < n_fields; i++) { + if (g_str_equal (fields[i].key, "MESSAGE")) +- terminal_printerr ("%s\n", (const char*)fields[i].value); ++ terminal_fprintf (stderr, level, "%s\n", (const char*)fields[i].value); + } + + return G_LOG_WRITER_HANDLED; +-- +2.40.1 + diff --git a/gnome-terminal.spec b/gnome-terminal.spec index 2f41727..1ace25c 100644 --- a/gnome-terminal.spec +++ b/gnome-terminal.spec @@ -7,7 +7,7 @@ Name: gnome-terminal Version: 3.28.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Terminal emulator for GNOME License: GPLv3+ and GFDL and LGPLv2+ @@ -24,6 +24,9 @@ Patch102: 0001-Add-a-manual.patch # https://bugzilla.redhat.com/show_bug.cgi?id=837035 Patch103: gnome-terminal-keypad-accels.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2154269 +Patch104: gnome-terminal-3.28.3-quiet-dconf-logging.patch + BuildRequires: docbook-style-xsl BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: gtk3-devel >= %{gtk3_version} @@ -71,6 +74,7 @@ option to the right-click context menu in Nautilus. %patch101 -p1 -b .warnings %patch102 -p1 -b .manual %patch103 -p1 -b .keypad-accels +%patch104 -p1 -b .dconf-logging %build autoreconf -f -i @@ -111,6 +115,9 @@ make check %{_datadir}/metainfo/org.gnome.Terminal.Nautilus.metainfo.xml %changelog +* Thu May 04 2023 David King - 3.28.3-4 +- Quiet dconf logging (#2154269) + * Mon Nov 30 2020 Debarshi Ray - 3.28.3-3 - Support using the '0', '+' and '-' keys from the numeric keypad as accelerators