Suppress Log By Default

This commit is contained in:
TheBrokenRail 2022-05-15 00:52:44 -04:00
parent 633e00f277
commit d673e9aab8
3 changed files with 14 additions and 3 deletions

View File

@ -123,8 +123,8 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data) {
text = gtk_builder_get_object (builder, "zenity_entry_text"); text = gtk_builder_get_object (builder, "zenity_entry_text");
if (entry_data->dialog_text) if (entry_data->dialog_text)
gtk_label_set_markup ( gtk_label_set_markup (
GTK_LABEL (text), g_strcompress (entry_data->dialog_text)); GTK_LABEL (text), g_strcompress (entry_data->dialog_text));
vbox = gtk_builder_get_object (builder, "vbox4"); vbox = gtk_builder_get_object (builder, "vbox4");

View File

@ -32,15 +32,26 @@
#include <locale.h> #include <locale.h>
#endif #endif
static GLogWriterOutput
zenity_suppress_log (GLogLevelFlags log_level, const GLogField *fields,
gsize n_fields, gpointer user_data) {
return G_LOG_WRITER_HANDLED;
}
gint gint
main (gint argc, gchar **argv) { main (gint argc, gchar **argv) {
ZenityParsingOptions *results; ZenityParsingOptions *results;
gint retval; gint retval;
const char *is_debug;
#ifdef HAVE_LOCALE_H #ifdef HAVE_LOCALE_H
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
#endif #endif
is_debug = getenv ("ZENITY_DEBUG");
if (is_debug == NULL || strlen (is_debug) < 1)
g_log_set_writer_func (zenity_suppress_log, NULL, NULL);
gtk_init (&argc, &argv); gtk_init (&argc, &argv);
results = zenity_option_parse (argc, argv); results = zenity_option_parse (argc, argv);

View File

@ -201,7 +201,7 @@ zenity_text (ZenityData *data, ZenityTextData *text_data) {
text_label = gtk_builder_get_object (builder, "zenity_text_label"); text_label = gtk_builder_get_object (builder, "zenity_text_label");
if (text_data->dialog_text) if (text_data->dialog_text)
gtk_label_set_markup ( gtk_label_set_markup (
GTK_LABEL (text_label), g_strcompress (text_data->dialog_text)); GTK_LABEL (text_label), g_strcompress (text_data->dialog_text));
zenity_util_show_dialog (dialog); zenity_util_show_dialog (dialog);