Commit 31b6abd4 authored by Thomas Haller's avatar Thomas Haller

config: adjust logging message for duplicate config prefix

The logging macros already prepend a "config: " prefix. Don't
repeat that in the message, otherwise we get

    config: config: signal SIGHUP (no changes from disk)

Now:

    config: signal: SIGHUP (no changes from disk)
parent cd476e4d
......@@ -2397,15 +2397,15 @@ _set_config_data (NMConfig *self, NMConfigData *new_data, NMConfigChangeFlags re
}
if (new_data) {
_LOGI ("config: signal %s (%s)",
_LOGI ("signal: %s (%s)",
nm_config_change_flags_to_string (changes, NULL, 0),
nm_config_data_get_config_description (new_data));
nm_config_data_log (new_data, "CONFIG: ", " ", NULL);
priv->config_data = new_data;
} else if (had_new_data)
_LOGI ("config: signal %s (no changes from disk)", nm_config_change_flags_to_string (changes, NULL, 0));
_LOGI ("signal: %s (no changes from disk)", nm_config_change_flags_to_string (changes, NULL, 0));
else
_LOGI ("config: signal %s", nm_config_change_flags_to_string (changes, NULL, 0));
_LOGI ("signal: %s", nm_config_change_flags_to_string (changes, NULL, 0));
g_signal_emit (self, signals[SIGNAL_CONFIG_CHANGED], 0,
new_data ? new_data : old_data,
changes, old_data);
......
......@@ -334,14 +334,14 @@ test_config_connectivity_check (void)
g_assert (nm_connectivity_check_enabled (connectivity));
/* disable connectivity checking */
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal *");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: *");
nm_config_set_connectivity_check_enabled (config, FALSE);
g_test_assert_expected_messages ();
g_assert (!nm_connectivity_check_enabled (connectivity));
/* re-enable connectivity checking */
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal *");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: *");
nm_config_set_connectivity_check_enabled (config, TRUE);
g_test_assert_expected_messages ();
......@@ -386,7 +386,7 @@ test_config_no_auto_default (void)
g_assert (!nm_config_get_no_auto_default_for_device (config, dev3));
g_assert (nm_config_get_no_auto_default_for_device (config, dev4));
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal NO_AUTO_DEFAULT,no-auto-default *");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: NO_AUTO_DEFAULT,no-auto-default *");
nm_config_set_no_auto_default_for_device (config, dev3);
g_test_assert_expected_messages ();
......@@ -597,9 +597,9 @@ _set_values_user (NMConfig *config,
config_data_before = g_object_ref (nm_config_get_data (config));
if (expected_changes != NM_CONFIG_CHANGE_NONE)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal *");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: *");
else
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal SIGHUP (no changes from disk)*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: SIGHUP (no changes from disk)*");
nm_config_reload (config, NM_CONFIG_CHANGE_CAUSE_SIGHUP);
......@@ -641,7 +641,7 @@ _set_values_intern (NMConfig *config,
&config_changed_data);
if (expected_changes != NM_CONFIG_CHANGE_NONE)
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal *");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: *");
nm_config_set_values (config, keyfile_intern, TRUE, FALSE);
......@@ -904,15 +904,15 @@ test_config_signal (void)
&expected);
expected = NM_CONFIG_CHANGE_CAUSE_SIGUSR1;
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal SIGUSR1");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: SIGUSR1");
nm_config_reload (config, expected);
expected = NM_CONFIG_CHANGE_CAUSE_SIGUSR2;
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal SIGUSR2");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: SIGUSR2");
nm_config_reload (config, expected);
expected = NM_CONFIG_CHANGE_CAUSE_SIGHUP;
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal SIGHUP (no changes from disk)*");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: SIGHUP (no changes from disk)*");
nm_config_reload (config, expected);
......@@ -925,7 +925,7 @@ test_config_signal (void)
G_CALLBACK (_test_signal_config_changed_cb2),
&expected);
expected = NM_CONFIG_CHANGE_CAUSE_SIGUSR2;
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal SIGUSR2");
g_test_expect_message ("NetworkManager", G_LOG_LEVEL_INFO, "*config: signal: SIGUSR2");
nm_config_reload (config, NM_CONFIG_CHANGE_CAUSE_SIGUSR2);
g_signal_handlers_disconnect_by_func (config, _test_signal_config_changed_cb2, &expected);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment