Revise and update terminal_log_writer, eliminate warning
The gnome-45
branch compiles with this warning (no idea why master
doesn't give the same warning):
../src/terminal-options.cc: In function ‘GLogWriterOutput terminal_log_writer(GLogLevelFlags, const GLogField*, gsize, gpointer)’:
../src/terminal-options.cc:108:38: warning: ‘gboolean g_log_writer_default_would_drop(GLogLevelFlags, const char*)’ is deprecated: Not available before 2.68 [-Wdeprecated-declarations]
108 | if (g_log_writer_default_would_drop(log_level, domain))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib.h:64,
from ../src/terminal-options.cc:28:
/usr/include/glib-2.0/glib/gmessages.h:251:17: note: declared here
251 | gboolean g_log_writer_default_would_drop (GLogLevelFlags log_level,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The top of the method says
* 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.
(clickable links: glib#2087 (closed), #42 (closed))
and below there's an #if GLIB_CHECK_VERSION(2, 68, 0)
branch, and the compiler doesn't understand that the code that requires glib >= 2.68 is within this branch.
Rather than using a big hammer of silencing deprecation warning, I think the code should be updated according to that FIXME. The linked issue has been fixed for 3 years, Glib 2.68 was released 2.5 years ago, so it's fair to bump the minimum required version and eliminate the #ifdef
and to update the code as desired.
I don't know what the intent was for this code to look like after that fix, so I'd leave it to you @chpe.