platform: don't write debug message to stderr

Use nm-logging instead.

(cherry picked from commit 07f95c371c)
This commit is contained in:
Thomas Haller 2015-03-26 12:27:47 +01:00
parent c0534e9a6d
commit 8eefbce9fa

View file

@ -1775,10 +1775,6 @@ add_object (NMPlatform *platform, struct nl_object *obj)
auto_nl_object struct nl_object *object = obj;
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
int nle;
struct nl_dump_params dp = {
.dp_type = NL_DUMP_DETAILS,
.dp_fd = stderr,
};
g_return_val_if_fail (object, FALSE);
@ -1794,7 +1790,18 @@ add_object (NMPlatform *platform, struct nl_object *obj)
break;
default:
error ("Netlink error adding %s: %s", to_string_object (platform, object), nl_geterror (nle));
nl_object_dump (object, &dp);
if (nm_logging_enabled (LOGL_DEBUG, LOGD_PLATFORM)) {
char buf[256];
struct nl_dump_params dp = {
.dp_type = NL_DUMP_DETAILS,
.dp_buf = buf,
.dp_buflen = sizeof (buf),
};
nl_object_dump (object, &dp);
buf[sizeof (buf) - 1] = '\0';
debug ("netlink object:\n%s", buf);
}
return FALSE;
}