141 | 141 |
g_free(string);
|
142 | 142 |
}
|
143 | 143 |
|
|
144 |
/** Implementation of GLogFunc for the GTK+ frontend.
|
|
145 |
*
|
|
146 |
* This will log messages going through the glib log system to the standard
|
|
147 |
* syslog.
|
|
148 |
*
|
|
149 |
* @param log_domain the log domain of the message
|
|
150 |
* @param log_level the log level of the message
|
|
151 |
* @param message the message to process
|
|
152 |
* @param user_data user data, set in g_log_set_handler()
|
|
153 |
*/
|
|
154 |
static GLogWriterOutput log_glib_structured_to_syslog(GLogLevelFlags log_level,
|
|
155 |
const GLogField *fields,
|
|
156 |
gsize n_fields,
|
|
157 |
gpointer user_data)
|
|
158 |
{
|
|
159 |
const char *domain = NULL;
|
|
160 |
const char *message = "(no message)";
|
|
161 |
gsize i;
|
|
162 |
|
|
163 |
for (i = 0; i < n_fields; i++) {
|
|
164 |
const GLogField *field = &fields[i];
|
|
165 |
|
|
166 |
if (g_strcmp0(field->key, "MESSAGE") == 0) {
|
|
167 |
message = field->value;
|
|
168 |
}
|
|
169 |
else if (g_strcmp0(field->key, "GLIB_DOMAIN") == 0) {
|
|
170 |
domain = field->value;
|
|
171 |
}
|
|
172 |
}
|
|
173 |
|
|
174 |
log_glib_to_syslog(domain, log_level, message, NULL);
|
|
175 |
return G_LOG_WRITER_HANDLED;
|
|
176 |
}
|
|
177 |
|
144 | 178 |
/** Make the given window fullscreen.
|
145 | 179 |
*
|
146 | 180 |
* @param window main window
|
|
286 | 320 |
fe_data->di_data = di_data;
|
287 | 321 |
|
288 | 322 |
(void) g_set_printerr_handler(print_to_syslog);
|
289 | |
(void) g_log_set_default_handler(log_glib_to_syslog, NULL);
|
|
323 |
g_log_set_writer_func(log_glib_structured_to_syslog, NULL, NULL);
|
290 | 324 |
|
291 | 325 |
make_fullscreen(fe_data->window);
|
292 | 326 |
set_shortcuts(fe);
|