From 50be2f5244886954c3addb24eb5bd6d0e67ed236 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 20 May 2019 15:30:18 +0200 Subject: [PATCH] settings: log settings plugin name Instead of [1558284380.2045] settings: Loaded settings plugin: SettingsPluginIfcfg ("/usr/lib64/NetworkManager/1.19.2/libnm-settings-plugin-ifcfg-rh.so") log [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. --- src/settings/nm-settings.c | 11 +++++++---- 1 file 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