application: only override log handler with --debug

This commit is contained in:
Georges Basile Stavracas Neto
2017-05-16 15:01:11 -03:00
parent dc72ff4924
commit f25a7b0dd8
2 changed files with 10 additions and 3 deletions
+10
View File
@@ -26,6 +26,7 @@
#include "css-code.h"
#include "gcal-application.h"
#include "gcal-debug.h"
#include "gcal-log.h"
#include "gcal-shell-search-provider.h"
#include "gcal-window.h"
@@ -77,6 +78,7 @@ static void gcal_application_quit (GSimpleAction *
G_DEFINE_TYPE (GcalApplication, gcal_application, GTK_TYPE_APPLICATION);
static gboolean show_version = FALSE;
static gboolean debug = FALSE;
static gchar* date = NULL;
static gchar* uuid = NULL;
@@ -86,6 +88,11 @@ static GOptionEntry gcal_application_goptions[] = {
G_OPTION_ARG_NONE, &show_version,
N_("Display version number"), NULL
},
{
"debug", 'd', 0,
G_OPTION_ARG_NONE, &debug,
N_("Enable debug messages"), NULL
},
{
"date", 'd', 0,
G_OPTION_ARG_STRING, &date,
@@ -293,6 +300,9 @@ gcal_application_command_line (GApplication *app,
return 0;
}
if (debug)
gcal_log_init ();
if (uuid != NULL)
{
gcal_application_set_uuid (GCAL_APPLICATION (app), uuid);
-3
View File
@@ -20,7 +20,6 @@
#include <config.h>
#include <gtk/gtk.h>
#include "gcal-application.h"
#include "gcal-log.h"
#include <glib/gi18n.h>
@@ -32,8 +31,6 @@ main (int argc,
GcalApplication *app;
int status;
gcal_log_init ();
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");