summaryrefslogtreecommitdiff
path: root/src/settings/plugins/ifcfg-rh
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-05-16 16:19:22 +0200
committerThomas Haller <thaller@redhat.com>2016-05-17 12:22:42 +0200
commitf3bd778d6d31ea50752c380bafc86cf588e9ad99 (patch)
tree8d75949f7c14245b4e8ad5a83043069e6339f638 /src/settings/plugins/ifcfg-rh
parenta519cc57b86815eece934c0a36e96aa2c0694386 (diff)
downloadNetworkManager-f3bd778d6d31ea50752c380bafc86cf588e9ad99.tar.gz
ifcfg-rh: use _NMLOG() macro in writer
This gives every logging line a proper "ifcfg-rh" prefix. But drop the " " prefixes.
Diffstat (limited to 'src/settings/plugins/ifcfg-rh')
-rw-r--r--src/settings/plugins/ifcfg-rh/writer.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c
index 96ed1f1a60..e99676dbf5 100644
--- a/src/settings/plugins/ifcfg-rh/writer.c
+++ b/src/settings/plugins/ifcfg-rh/writer.c
@@ -53,6 +53,19 @@
#include "utils.h"
#include "crypto.h"
+/*****************************************************************************/
+
+#define _NMLOG_DOMAIN LOGD_SETTINGS
+#define _NMLOG_PREFIX_NAME "ifcfg-rh"
+#define _NMLOG(level, ...) \
+ G_STMT_START { \
+ nm_log ((level), (_NMLOG_DOMAIN), \
+ "%s" _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
+ _NMLOG_PREFIX_NAME": " \
+ _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
+ } G_STMT_END
+
+/*****************************************************************************/
static void
save_secret_flags (shvarFile *ifcfg,
@@ -100,7 +113,7 @@ set_secret (shvarFile *ifcfg,
{
shvarFile *keyfile;
GError *error = NULL;
-
+
/* Clear the secret from the ifcfg and the associated "keys" file */
svSetValue (ifcfg, key, NULL, FALSE);
@@ -109,7 +122,7 @@ set_secret (shvarFile *ifcfg,
keyfile = utils_get_keys_ifcfg (ifcfg->fileName, TRUE);
if (!keyfile) {
- nm_log_warn (LOGD_SETTINGS, " could not create ifcfg file for '%s'", ifcfg->fileName);
+ _LOGW ("could not create ifcfg file for '%s'", ifcfg->fileName);
goto error;
}
@@ -121,8 +134,8 @@ set_secret (shvarFile *ifcfg,
svSetValue (keyfile, key, value, verbatim);
if (!svWriteFile (keyfile, 0600, &error)) {
- nm_log_warn (LOGD_SETTINGS, " could not update ifcfg file '%s': %s",
- keyfile->fileName, error->message);
+ _LOGW ("could not update ifcfg file '%s': %s",
+ keyfile->fileName, error->message);
g_clear_error (&error);
svCloseFile (keyfile);
goto error;
@@ -715,7 +728,7 @@ write_wireless_security_setting (NMConnection *connection,
key = ascii_key;
}
} else {
- nm_log_warn (LOGD_SETTINGS, " invalid WEP key '%s'", key);
+ _LOGW ("invalid WEP key '%s'", key);
tmp = NULL;
}