diff options
author | Richard Hughes <richard@hughsie.com> | 2009-11-23 12:17:26 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2009-11-23 12:17:26 +0000 |
commit | faa4ad45536b9d523964093adff5bf7c8f9f061d (patch) | |
tree | 2313c34ec16aa02bca59d8895e4e98d4406c15cf /client | |
parent | 00e9e4bfc429bfd41401421068b123d98cdcc446 (diff) |
Update to a better version of the egg-debug code
Diffstat (limited to 'client')
-rw-r--r-- | client/Makefile.am | 4 | ||||
-rw-r--r-- | client/pk-console.c | 8 | ||||
-rw-r--r-- | client/pk-generate-pack.c | 6 | ||||
-rw-r--r-- | client/pk-monitor.c | 10 | ||||
-rw-r--r-- | client/pk-self-test.c | 2 |
5 files changed, 6 insertions, 24 deletions
diff --git a/client/Makefile.am b/client/Makefile.am index 81bb546d..2fb64a1c 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -42,10 +42,6 @@ INCLUDES = \ -DPK_DATA=\"$(pkgdatadir)\" \ -DPK_DB_DIR=\""$(PK_DB_DIR)"\" \ -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ - -DEGG_LOG_FILE=\""$(PK_LOG_DIR)/PackageKit"\" \ - -DEGG_VERBOSE="\"PK_VERBOSE\"" \ - -DEGG_LOGGING="\"PK_LOGGING\"" \ - -DEGG_CONSOLE="\"PK_CONSOLE\"" \ -I$(top_srcdir)/lib \ $(NULL) diff --git a/client/pk-console.c b/client/pk-console.c index 16035837..33fb2b56 100644 --- a/client/pk-console.c +++ b/client/pk-console.c @@ -1127,7 +1127,6 @@ main (int argc, char *argv[]) { gboolean ret; GError *error = NULL; - gboolean verbose = FALSE; gboolean background = FALSE; gboolean noninteractive = FALSE; gboolean program_version = FALSE; @@ -1145,9 +1144,6 @@ main (int argc, char *argv[]) gint retval = EXIT_SUCCESS; const GOptionEntry options[] = { - { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, - /* TRANSLATORS: command line argument, if we should show debugging information */ - _("Show extra debugging information"), NULL }, { "version", '\0', 0, G_OPTION_ARG_NONE, &program_version, /* TRANSLATORS: command line argument, just show the version string */ _("Show the program version and exit"), NULL}, @@ -1207,14 +1203,12 @@ main (int argc, char *argv[]) context = g_option_context_new ("PackageKit Console Program"); g_option_context_set_summary (context, summary) ; g_option_context_add_main_entries (context, options, NULL); + g_option_context_add_group (context, egg_debug_get_option_group ()); g_option_context_parse (context, &argc, &argv, NULL); /* Save the usage string in case command parsing fails. */ options_help = g_option_context_get_help (context, TRUE, NULL); g_option_context_free (context); - /* we are now parsed */ - egg_debug_init (verbose); - if (program_version) { g_print (VERSION "\n"); goto out_last; diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c index 7ae8abe8..36defeae 100644 --- a/client/pk-generate-pack.c +++ b/client/pk-generate-pack.c @@ -210,8 +210,6 @@ main (int argc, char *argv[]) gchar **excludes = NULL; gchar *package_id = NULL; PkServicePack *pack = NULL; - - gboolean verbose = FALSE; gchar *directory = NULL; gchar *package_list = NULL; gchar *package = NULL; @@ -219,8 +217,6 @@ main (int argc, char *argv[]) gint retval = 1; const GOptionEntry options[] = { - { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, - _("Show extra debugging information"), NULL }, { "with-package-list", 'l', 0, G_OPTION_ARG_STRING, &package_list, /* TRANSLATORS: we can exclude certain packages (glibc) when we know they'll exist on the target */ _("Set the file name of dependencies to be excluded"), NULL}, @@ -252,11 +248,11 @@ main (int argc, char *argv[]) context = g_option_context_new ("PackageKit Pack Generator"); g_option_context_add_main_entries (context, options, NULL); + g_option_context_add_group (context, egg_debug_get_option_group ()); g_option_context_parse (context, &argc, &argv, NULL); /* Save the usage string in case command parsing fails. */ options_help = g_option_context_get_help (context, TRUE, NULL); g_option_context_free (context); - egg_debug_init (verbose); client = pk_client_new (); pack = pk_service_pack_new (); diff --git a/client/pk-monitor.c b/client/pk-monitor.c index 85699913..f230f7ac 100644 --- a/client/pk-monitor.c +++ b/client/pk-monitor.c @@ -30,7 +30,6 @@ #include "egg-debug.h" -static gboolean verbose = FALSE; static PkClient *client = NULL; /** @@ -234,7 +233,7 @@ static void pk_monitor_transaction_list_changed_cb (PkControl *control, gchar **transaction_ids, gpointer user_data) { /* only print state when verbose */ - if (verbose) + if (egg_debug_is_verbose ()) pk_monitor_get_daemon_state (control); } @@ -277,8 +276,6 @@ main (int argc, char *argv[]) guint i; const GOptionEntry options[] = { - { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, - _("Show extra debugging information"), NULL }, { "version", '\0', 0, G_OPTION_ARG_NONE, &program_version, _("Show the program version and exit"), NULL}, { NULL} @@ -298,6 +295,7 @@ main (int argc, char *argv[]) /* TRANSLATORS: this is a program that monitors PackageKit */ g_option_context_set_summary (context, _("PackageKit Monitor")); g_option_context_add_main_entries (context, options, NULL); + g_option_context_add_group (context, egg_debug_get_option_group ()); g_option_context_parse (context, &argc, &argv, NULL); g_option_context_free (context); @@ -306,8 +304,6 @@ main (int argc, char *argv[]) goto out; } - egg_debug_init (verbose); - loop = g_main_loop_new (NULL, FALSE); control = pk_control_new (); @@ -341,7 +337,7 @@ main (int argc, char *argv[]) pk_monitor_list_print (tlist); /* only print state when verbose */ - if (verbose) + if (egg_debug_is_verbose ()) pk_monitor_get_daemon_state (control); /* spin */ diff --git a/client/pk-self-test.c b/client/pk-self-test.c index eba7cc5c..3214675e 100644 --- a/client/pk-self-test.c +++ b/client/pk-self-test.c @@ -37,7 +37,7 @@ main (int argc, char **argv) g_type_init (); test = egg_test_init (); - egg_debug_init (TRUE); + egg_debug_init (&argc, &argv); /* tests go here */ //pk_genpack_test (test); |