[gnome-calendar/gnome-3-24] application: only override log handler with --debug
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gnome-3-24] application: only override log handler with --debug
- Date: Tue, 16 May 2017 18:05:08 +0000 (UTC)
commit 58ce3cc4431a516e81da455f6b9c4a7aa605b581
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue May 16 15:01:11 2017 -0300
application: only override log handler with --debug
src/gcal-application.c | 10 ++++++++++
src/main.c | 3 ---
2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-application.c b/src/gcal-application.c
index b73f546..acb25e5 100644
--- a/src/gcal-application.c
+++ b/src/gcal-application.c
@@ -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;
@@ -87,6 +89,11 @@ static GOptionEntry gcal_application_goptions[] = {
N_("Display version number"), NULL
},
{
+ "debug", 'd', 0,
+ G_OPTION_ARG_NONE, &debug,
+ "Enable debug messages", NULL
+ },
+ {
"date", 'd', 0,
G_OPTION_ARG_STRING, &date,
N_("Open calendar on the passed date"), NULL
@@ -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);
diff --git a/src/main.c b/src/main.c
index 530234b..5374277 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]