diff options
Diffstat (limited to 'src/qmicli/qmicli.c')
-rw-r--r-- | src/qmicli/qmicli.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/qmicli/qmicli.c b/src/qmicli/qmicli.c index 76d0565e..76411865 100644 --- a/src/qmicli/qmicli.c +++ b/src/qmicli/qmicli.c @@ -16,6 +16,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Copyright (C) 2012-2017 Aleksander Morgado <aleksander@aleksander.es> + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. */ #include "config.h" @@ -68,6 +69,7 @@ static gboolean device_open_auto_flag; static gchar *client_cid_str; static gboolean client_no_release_cid_flag; static gboolean verbose_flag; +static gboolean verbose_full_flag; static gboolean silent_flag; static gboolean version_flag; @@ -129,6 +131,10 @@ static GOptionEntry main_entries[] = { "Run action with verbose logs, including the debug ones", NULL }, + { "verbose-full", 0, 0, G_OPTION_ARG_NONE, &verbose_full_flag, + "Run action with verbose logs, including the debug ones and personal info", + NULL + }, { "silent", 0, 0, G_OPTION_ARG_NONE, &silent_flag, "Run action with no logs; not even the error/warning ones", NULL @@ -210,7 +216,7 @@ log_handler (const gchar *log_domain, g_assert_not_reached (); } - if (!verbose_flag && !err) + if (!verbose_flag && !verbose_full_flag && !err) return; g_fprintf (err ? stderr : stdout, @@ -1018,14 +1024,28 @@ 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); + } #if QMI_MBIM_QMUX_SUPPORTED /* libmbim logging */ g_log_set_handler ("Mbim", G_LOG_LEVEL_MASK, log_handler, NULL); - if (verbose_flag) + 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); + } #endif #if QMI_QRTR_SUPPORTED |