summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-09-20 14:17:20 +0200
committerThomas Haller <thaller@redhat.com>2016-09-26 10:52:12 +0200
commit1a257a675277a17dc16ab8d8a0ef4c43e6e05cb8 (patch)
tree7403edd39fb06bc77c0fd72e785a1ba198594885
parente152eea21819cb31e6da779b06ae1b6df7270bb1 (diff)
downloadNetworkManager-1a257a675277a17dc16ab8d8a0ef4c43e6e05cb8.tar.gz
config: use logging macros
For some logging lines we used the wrong logging domain LOGD_SETTINGS instead of LOGD_CORE.
-rw-r--r--src/nm-config.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/nm-config.c b/src/nm-config.c
index 4bc4f48340..a4e8eb8cdb 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -418,8 +418,8 @@ nm_config_set_no_auto_default_for_device (NMConfig *self, NMDevice *device)
g_ptr_array_add (no_auto_default_new, NULL);
if (!no_auto_default_to_file (priv->no_auto_default_file, (const char *const*) no_auto_default_new->pdata, &error)) {
- nm_log_warn (LOGD_SETTINGS, "Could not update no-auto-default.state file: %s",
- error->message);
+ _LOGW ("Could not update no-auto-default.state file: %s",
+ error->message);
g_error_free (error);
}
@@ -680,7 +680,7 @@ read_config (GKeyFile *keyfile, gboolean is_base_config, const char *dirname, co
return FALSE;
}
- nm_log_dbg (LOGD_SETTINGS, "Reading config file '%s'", path);
+ _LOGD ("Reading config file '%s'", path);
kf = nm_config_create_keyfile ();
if (!g_key_file_load_from_file (kf, path, G_KEY_FILE_NONE, error)) {
@@ -866,8 +866,8 @@ read_base_config (GKeyFile *keyfile,
}
if (!g_error_matches (my_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND)) {
- nm_log_warn (LOGD_CORE, "Old default config file invalid: %s\n",
- my_error->message);
+ _LOGW ("Old default config file invalid: %s\n",
+ my_error->message);
}
g_clear_error (&my_error);
@@ -878,8 +878,8 @@ read_base_config (GKeyFile *keyfile,
}
if (!g_error_matches (my_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND)) {
- nm_log_warn (LOGD_CORE, "Default config file invalid: %s\n",
- my_error->message);
+ _LOGW ("Default config file invalid: %s\n",
+ my_error->message);
g_propagate_error (error, my_error);
return FALSE;
}
@@ -889,8 +889,8 @@ read_base_config (GKeyFile *keyfile,
* config file path.
*/
*out_config_main_file = g_strdup (DEFAULT_CONFIG_MAIN_FILE);
- nm_log_info (LOGD_CORE, "No config file found or given; using %s\n",
- DEFAULT_CONFIG_MAIN_FILE);
+ _LOGI ("No config file found or given; using %s\n",
+ DEFAULT_CONFIG_MAIN_FILE);
return TRUE;
}
@@ -1303,7 +1303,7 @@ out:
if (out_needs_rewrite)
*out_needs_rewrite = needs_rewrite;
- nm_log_dbg (LOGD_CORE, "intern config file \"%s\"", filename);
+ _LOGD ("intern config file \"%s\"", filename);
if (!has_intern) {
g_key_file_unref (keyfile_intern);
@@ -1502,7 +1502,7 @@ intern_config_write (const char *filename,
success = g_key_file_save_to_file (keyfile, filename, &local);
- nm_log_dbg (LOGD_CORE, "write intern config file \"%s\"%s%s", filename, success ? "" : ": ", success ? "" : local->message);
+ _LOGD ("write intern config file \"%s\"%s%s", filename, success ? "" : ": ", success ? "" : local->message);
g_key_file_unref (keyfile);
if (!success)
g_propagate_error (error, local);
@@ -1658,7 +1658,7 @@ nm_config_set_values (NMConfig *self,
if (!_nm_keyfile_equals (keyfile_intern_current, keyfile_new, TRUE))
new_data = nm_config_data_new_update_keyfile_intern (priv->config_data, keyfile_new);
- nm_log_dbg (LOGD_CORE, "set values(): %s", new_data ? "has changes" : "no changes");
+ _LOGD ("set values(): %s", new_data ? "has changes" : "no changes");
if (allow_write
&& (new_data || force_rewrite)) {
@@ -1673,11 +1673,11 @@ nm_config_set_values (NMConfig *self,
keyfile_user = _nm_config_data_get_keyfile_user (priv->config_data);
if (!intern_config_write (priv->intern_config_file, keyfile_new, keyfile_user,
(const char *const*) priv->atomic_section_prefixes, &local)) {
- nm_log_warn (LOGD_CORE, "error saving internal configuration \"%s\": %s", priv->intern_config_file, local->message);
+ _LOGW ("error saving internal configuration \"%s\": %s", priv->intern_config_file, local->message);
g_clear_error (&local);
}
} else
- nm_log_dbg (LOGD_CORE, "don't persistate internal configuration (no file set, use --intern-config?)");
+ _LOGD ("don't persist internal configuration (no file set, use --intern-config?)");
}
if (new_data)
_set_config_data (self, new_data, NM_CONFIG_CHANGE_CAUSE_SET_VALUES);
@@ -1907,7 +1907,7 @@ nm_config_reload (NMConfig *self, NMConfigChangeFlags reload_flags)
&config_description,
&error);
if (!keyfile) {
- nm_log_err (LOGD_CORE, "Failed to reload the configuration: %s", error->message);
+ _LOGE ("Failed to reload the configuration: %s", error->message);
g_clear_error (&error);
_set_config_data (self, NULL, reload_flags);
return;
@@ -1989,15 +1989,15 @@ _set_config_data (NMConfig *self, NMConfigData *new_data, NMConfigChangeFlags re
}
if (new_data) {
- nm_log_info (LOGD_CORE, "config: signal %s (%s)",
- nm_config_change_flags_to_string (changes, NULL, 0),
- nm_config_data_get_config_description (new_data));
+ _LOGI ("config: 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)
- nm_log_info (LOGD_CORE, "config: signal %s (no changes from disk)", nm_config_change_flags_to_string (changes, NULL, 0));
+ _LOGI ("config: signal %s (no changes from disk)", nm_config_change_flags_to_string (changes, NULL, 0));
else
- nm_log_info (LOGD_CORE, "config: signal %s", nm_config_change_flags_to_string (changes, NULL, 0));
+ _LOGI ("config: 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);