summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristof Meerwald <cmeerw@cmeerw.org>2022-11-02 18:07:07 +0100
committerChristof Meerwald <cmeerw@cmeerw.org>2022-11-02 18:07:07 +0100
commitb1ca838868c8a975f3bb616519e4b3eeecbeac1b (patch)
tree05caa256a6a2acff4b14866717962ed6738a5b3d
parent37825b4ecbffdf94eb3af935ce7e8032be63f99a (diff)
downloadlibmbim-b1ca838868c8a975f3bb616519e4b3eeecbeac1b.tar.gz
mbim-proxy: add --verbose-full flag
-rw-r--r--src/mbim-proxy/mbim-proxy.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mbim-proxy/mbim-proxy.c b/src/mbim-proxy/mbim-proxy.c
index 35633db..bf84d49 100644
--- a/src/mbim-proxy/mbim-proxy.c
+++ b/src/mbim-proxy/mbim-proxy.c
@@ -34,6 +34,7 @@ static guint client_connected_once = FALSE;
/* 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;
@@ -51,6 +52,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
@@ -109,7 +114,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);
@@ -215,8 +220,16 @@ int main (int argc, char **argv)
g_log_set_handler (NULL, G_LOG_LEVEL_MASK, log_handler, NULL);
g_log_set_handler ("Mbim", 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) {
mbim_utils_set_traces_enabled (TRUE);
+ mbim_utils_set_show_personal_info (FALSE);
+ } else if (verbose_full_flag) {
+ mbim_utils_set_traces_enabled (TRUE);
+ mbim_utils_set_show_personal_info (TRUE);
+ }
/* Setup signals */
g_unix_signal_add (SIGINT, quit_cb, NULL);