mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-09 13:25:35 +00:00
application: Handle setting verbosity first
We want logging verbosity to be set before other command line options are handled as we might be missing messages otherwise.
This commit is contained in:
parent
813103e684
commit
d690fe5f68
1 changed files with 11 additions and 12 deletions
|
@ -516,6 +516,17 @@ calls_application_command_line (GApplication *application,
|
||||||
|
|
||||||
options = g_application_command_line_get_options_dict (command_line);
|
options = g_application_command_line_get_options_dict (command_line);
|
||||||
|
|
||||||
|
/* TODO make this a comma separated string of "CATEGORY:level" pairs */
|
||||||
|
if (g_variant_dict_lookup (options, "verbosity", "u", &verbosity)) {
|
||||||
|
gint delta = calls_log_set_verbosity (verbosity);
|
||||||
|
guint level = calls_log_get_verbosity ();
|
||||||
|
if (delta != 0)
|
||||||
|
g_print ("%s verbosity by %d to %u\n",
|
||||||
|
delta > 0 ? "Increased" : "Decreased",
|
||||||
|
delta < 0 ? -1 * delta : delta,
|
||||||
|
level);
|
||||||
|
}
|
||||||
|
|
||||||
providers = g_variant_dict_lookup_value (options, "provider", G_VARIANT_TYPE_STRING_ARRAY);
|
providers = g_variant_dict_lookup_value (options, "provider", G_VARIANT_TYPE_STRING_ARRAY);
|
||||||
if (providers) {
|
if (providers) {
|
||||||
g_action_group_activate_action (G_ACTION_GROUP (application),
|
g_action_group_activate_action (G_ACTION_GROUP (application),
|
||||||
|
@ -534,18 +545,6 @@ calls_application_command_line (GApplication *application,
|
||||||
if (g_variant_dict_lookup (options, "dial", "&s", &arg))
|
if (g_variant_dict_lookup (options, "dial", "&s", &arg))
|
||||||
g_action_group_activate_action (G_ACTION_GROUP (application),
|
g_action_group_activate_action (G_ACTION_GROUP (application),
|
||||||
"dial", g_variant_new_string (arg));
|
"dial", g_variant_new_string (arg));
|
||||||
|
|
||||||
/* TODO make this a comma separated string of "CATEGORY:level" pairs */
|
|
||||||
if (g_variant_dict_lookup (options, "verbosity", "u", &verbosity)) {
|
|
||||||
gint delta = calls_log_set_verbosity (verbosity);
|
|
||||||
guint level = calls_log_get_verbosity ();
|
|
||||||
if (delta != 0)
|
|
||||||
g_print ("%s verbosity by %d to %u\n",
|
|
||||||
delta > 0 ? "Increased" : "Decreased",
|
|
||||||
delta < 0 ? -1 * delta : delta,
|
|
||||||
level);
|
|
||||||
}
|
|
||||||
|
|
||||||
arguments = g_application_command_line_get_arguments (command_line, &argc);
|
arguments = g_application_command_line_get_arguments (command_line, &argc);
|
||||||
|
|
||||||
/* Keep only the first URI, if there are many */
|
/* Keep only the first URI, if there are many */
|
||||||
|
|
Loading…
Reference in a new issue