diff options
author | Christof Meerwald <cmeerw@cmeerw.org> | 2022-10-31 21:18:49 +0100 |
---|---|---|
committer | Christof Meerwald <cmeerw@cmeerw.org> | 2022-11-02 18:06:17 +0100 |
commit | 3a1ebb5e5b3a5b53619547eece39d8bc210d75a9 (patch) | |
tree | c96ce90658806f807927635761ac9232d3b3f956 | |
parent | e7af30049f9146aba651bb03afe2911bb52a49ae (diff) | |
download | libqmi-3a1ebb5e5b3a5b53619547eece39d8bc210d75a9.tar.gz |
qmi-proxy: add --verbose-full flag
-rw-r--r-- | src/qmi-proxy/qmi-proxy.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/qmi-proxy/qmi-proxy.c b/src/qmi-proxy/qmi-proxy.c index 17224ffe..7f0724c1 100644 --- a/src/qmi-proxy/qmi-proxy.c +++ b/src/qmi-proxy/qmi-proxy.c @@ -44,6 +44,7 @@ static guint timeout_id; /* Main options */ static gboolean verbose_flag; +static gboolean verbose_full_flag; static gboolean version_flag; static gboolean no_exit_flag; static gint empty_timeout = -1; @@ -61,6 +62,10 @@ static GOptionEntry main_entries[] = { "Run action with verbose logs, including the debug ones", NULL }, + { "verbose-full", 'v', 0, G_OPTION_ARG_NONE, &verbose_full_flag, + "Run action with verbose logs, including the debug ones and personal info", + NULL + }, { "version", 'V', 0, G_OPTION_ARG_NONE, &version_flag, "Print version", NULL @@ -119,7 +124,7 @@ log_handler (const gchar *log_domain, g_assert_not_reached (); } - if (!verbose_flag && !err) + if (!verbose_flag && !verbose_full_flag && !err) return; now = time ((time_t *) NULL); @@ -200,8 +205,16 @@ int main (int argc, char **argv) g_log_set_handler (NULL, G_LOG_LEVEL_MASK, log_handler, NULL); g_log_set_handler ("Qmi", G_LOG_LEVEL_MASK, log_handler, NULL); - if (verbose_flag) + if (verbose_flag && verbose_full_flag) { + g_printerr ("error: cannot specify --verbose and --verbose-full at the same time\n"); + exit (EXIT_FAILURE); + } else if (verbose_flag) { qmi_utils_set_traces_enabled (TRUE); + qmi_utils_set_show_personal_info (FALSE); + } else if (verbose_full_flag) { + qmi_utils_set_traces_enabled (TRUE); + qmi_utils_set_show_personal_info (TRUE); + } /* Setup signals */ g_unix_signal_add (SIGINT, quit_cb, NULL); |