summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-05-20 15:30:18 +0200
committerThomas Haller <thaller@redhat.com>2019-06-12 11:09:46 +0200
commitce8359d1cf8c26d766a4439f31bf020a4bb5db0e (patch)
treedcc85066d863361660928a19858394974f38dd46
parentcf984f17bf66bcdaf4e45d5f94d7212b2c3de8e9 (diff)
downloadNetworkManager-ce8359d1cf8c26d766a4439f31bf020a4bb5db0e.tar.gz
settings: log settings plugin name
Instead of <info> [1558284380.2045] settings: Loaded settings plugin: SettingsPluginIfcfg ("/usr/lib64/NetworkManager/1.19.2/libnm-settings-plugin-ifcfg-rh.so") log <info> [1558284380.2045] settings: Loaded settings plugin: ifcfg-rh ("/usr/lib64/NetworkManager/1.19.2/libnm-settings-plugin-ifcfg-rh.so") Note how `man NetworkManager.conf` documents "main.plugins" configuration option where settings plugins have names like "keyfile" and "ifcfg-rh". It's not helpful to log the GObject type name, which is an implementation detail.
-rw-r--r--src/settings/nm-settings.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index ab7b7b1aef..817cbc1374 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -596,7 +596,10 @@ unrecognized_specs_changed (NMSettingsPlugin *config,
}
static void
-add_plugin (NMSettings *self, NMSettingsPlugin *plugin, const char *path)
+add_plugin (NMSettings *self,
+ NMSettingsPlugin *plugin,
+ const char *pname,
+ const char *path)
{
NMSettingsPrivate *priv;
@@ -612,7 +615,7 @@ add_plugin (NMSettings *self, NMSettingsPlugin *plugin, const char *path)
nm_settings_plugin_initialize (plugin);
_LOGI ("Loaded settings plugin: %s (%s%s%s)",
- G_OBJECT_TYPE_NAME (plugin),
+ pname,
NM_PRINT_FMT_QUOTED (path, "\"", path, "\"", "internal"));
}
@@ -677,7 +680,7 @@ add_plugin_load_file (NMSettings *self, const char *pname, GError **error)
return FALSE;
}
- add_plugin (self, NM_SETTINGS_PLUGIN (plugin), path);
+ add_plugin (self, NM_SETTINGS_PLUGIN (plugin), pname, path);
return TRUE;
}
@@ -687,7 +690,7 @@ add_plugin_keyfile (NMSettings *self)
gs_unref_object NMSKeyfilePlugin *keyfile_plugin = NULL;
keyfile_plugin = nms_keyfile_plugin_new ();
- add_plugin (self, NM_SETTINGS_PLUGIN (keyfile_plugin), NULL);
+ add_plugin (self, NM_SETTINGS_PLUGIN (keyfile_plugin), "keyfile", NULL);
}
static gboolean