From 1f1a28ae20813df93912b771340f33c534257437 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 7 Apr 2010 12:28:57 -0700 Subject: [PATCH] core: update logging in misc files --- src/NetworkManagerUtils.c | 9 +++++---- src/nm-active-connection.c | 5 +++-- src/nm-call-store.c | 9 +++++---- src/nm-netlink-monitor.c | 10 +++++----- src/nm-netlink.c | 12 ++++++------ src/nm-secrets-provider-interface.c | 6 +++--- 6 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 100ccd363..4bd57d994 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2004 - 2008 Red Hat, Inc. + * Copyright (C) 2004 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. */ @@ -28,6 +28,7 @@ #include "NetworkManagerUtils.h" #include "nm-utils.h" +#include "nm-logging.h" #include "nm-device.h" #include "nm-device-wifi.h" #include "nm-device-ethernet.h" @@ -85,13 +86,13 @@ nm_spawn_process (const char *args) g_return_val_if_fail (args != NULL, -1); if (!g_shell_parse_argv (args, &num_args, &argv, &error)) { - nm_warning ("could not parse arguments for '%s': %s", args, error->message); + nm_log_warn (LOGD_CORE, "could not parse arguments for '%s': %s", args, error->message); g_error_free (error); return -1; } if (!g_spawn_sync ("/", argv, NULL, 0, NULL, NULL, NULL, NULL, &status, &error)) { - nm_warning ("could not spawn process '%s': %s", args, error->message); + nm_log_warn (LOGD_CORE, "could not spawn process '%s': %s", args, error->message); g_error_free (error); } @@ -394,7 +395,7 @@ nm_utils_call_dispatcher (const char *action, NM_DISPATCHER_DBUS_PATH, NM_DISPATCHER_DBUS_IFACE); if (!proxy) { - nm_warning ("Error: could not get dispatcher proxy!"); + nm_log_err (LOGD_CORE, "could not get dispatcher proxy!"); g_object_unref (dbus_mgr); return; } diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c index 019b5c3fc..4207e1450 100644 --- a/src/nm-active-connection.c +++ b/src/nm-active-connection.c @@ -15,13 +15,14 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2010 Red Hat, Inc. */ #include #include "nm-active-connection.h" #include "NetworkManager.h" #include "nm-active-connection-glue.h" +#include "nm-logging.h" char * nm_active_connection_get_next_object_path (void) @@ -54,7 +55,7 @@ nm_active_connection_scope_to_value (NMConnection *connection, GValue *value) g_value_set_string (value, NM_DBUS_SERVICE_USER_SETTINGS); break; default: - g_warning ("%s: unknown connection scope!", __func__); + nm_log_err (LOGD_CORE, "unknown connection scope!"); break; } } diff --git a/src/nm-call-store.c b/src/nm-call-store.c index 837edf023..df400d0ff 100644 --- a/src/nm-call-store.c +++ b/src/nm-call-store.c @@ -16,10 +16,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2007 Novell, Inc. + * Copyright (C) 2010 Red Hat, Inc. */ #include "nm-call-store.h" -#include "nm-utils.h" +#include "nm-logging.h" NMCallStore * nm_call_store_new (void) @@ -68,12 +69,12 @@ nm_call_store_remove (NMCallStore *store, call_ids_hash = g_hash_table_lookup (store, object); if (!call_ids_hash) { - nm_warning ("Trying to remove a non-existant call id."); + nm_log_warn (LOGD_CORE, "Trying to remove a non-existant call id."); return; } if (!g_hash_table_remove (call_ids_hash, call_id)) - nm_warning ("Trying to remove a non-existant call id."); + nm_log_warn (LOGD_CORE, "Trying to remove a non-existant call id."); if (g_hash_table_size (call_ids_hash) == 0) { g_hash_table_remove (store, object); @@ -162,7 +163,7 @@ nm_call_store_foreach (NMCallStore *store, call_ids_hash = g_hash_table_lookup (store, object); if (!call_ids_hash) { - nm_warning ("Object not in store"); + nm_log_warn (LOGD_CORE, "Object not in store"); return -1; } diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 04f87b4b1..36cd99e2d 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -15,7 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright (C) 2005 - 2008 Red Hat, Inc. + * Copyright (C) 2005 - 2010 Red Hat, Inc. * Copyright (C) 2005 - 2008 Novell, Inc. * Copyright (C) 2005 Ray Strode * @@ -43,7 +43,7 @@ #include "NetworkManager.h" #include "nm-system.h" #include "nm-netlink-monitor.h" -#include "nm-utils.h" +#include "nm-logging.h" #include "nm-marshal.h" #include "nm-netlink.h" @@ -407,9 +407,9 @@ deferred_emit_carrier_state (gpointer user_data) /* Update the link cache with latest state, and if there are no errors * emit the link states for all the interfaces in the cache. */ - if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) - nm_warning ("error updating link cache: %s", nl_geterror ()); - else { + if (nl_cache_refill (priv->nlh, priv->nlh_link_cache)) { + nm_log_err (LOGD_HW, "error updating link cache: %s", nl_geterror ()); + } else { nl_cache_foreach_filter (priv->nlh_link_cache, NULL, netlink_object_message_handler, diff --git a/src/nm-netlink.c b/src/nm-netlink.c index ad68790db..c55c093ae 100644 --- a/src/nm-netlink.c +++ b/src/nm-netlink.c @@ -21,7 +21,7 @@ #include "config.h" #include "nm-netlink.h" -#include "nm-utils.h" +#include "nm-logging.h" #include #include @@ -40,7 +40,7 @@ get_link_cache (void) nlh = nm_netlink_get_default_handle (); if (G_UNLIKELY (!nlh)) { - nm_warning ("couldn't allocate netlink handle."); + nm_log_err (LOGD_HW, "couldn't allocate netlink handle."); return NULL; } @@ -48,7 +48,7 @@ get_link_cache (void) link_cache = rtnl_link_alloc_cache (nlh); if (G_UNLIKELY (!link_cache)) { - nm_warning ("couldn't allocate netlink link cache: %s", nl_geterror ()); + nm_log_err (LOGD_HW, "couldn't allocate netlink link cache: %s", nl_geterror ()); return NULL; } @@ -71,12 +71,12 @@ nm_netlink_get_default_handle (void) cb = nl_cb_alloc(NL_CB_VERBOSE); def_nl_handle = nl_handle_alloc_cb (cb); if (!def_nl_handle) { - nm_warning ("couldn't allocate netlink handle."); + nm_log_err (LOGD_HW, "couldn't allocate netlink handle."); return NULL; } if (nl_connect (def_nl_handle, NETLINK_ROUTE) < 0) { - nm_error ("couldn't connect to netlink: %s", nl_geterror ()); + nm_log_err (LOGD_HW, "couldn't connect to netlink: %s", nl_geterror ()); return NULL; } @@ -123,7 +123,7 @@ nm_netlink_index_to_iface (int idx) buf = g_malloc0 (MAX_IFACE_LEN); if (buf == NULL) { - nm_warning ("Not enough memory to allocate interface name buffer."); + nm_log_warn (LOGD_HW, "Not enough memory to allocate interface name buffer."); return NULL; } diff --git a/src/nm-secrets-provider-interface.c b/src/nm-secrets-provider-interface.c index 9bbde7a39..47b8e57ef 100644 --- a/src/nm-secrets-provider-interface.c +++ b/src/nm-secrets-provider-interface.c @@ -25,7 +25,7 @@ #include #include -#include "nm-utils.h" +#include "nm-logging.h" static void nm_secrets_provider_interface_init (gpointer g_iface) @@ -108,7 +108,7 @@ nm_secrets_provider_interface_get_secrets (NMSecretsProviderInterface *self, connection, setting_name, request_new, caller, hint1, hint2, &success); if (!success) { - nm_warning ("failed to get connection secrets."); + nm_log_warn (LOGD_CORE, "failed to get connection secrets."); return FALSE; } @@ -193,7 +193,7 @@ nm_secrets_provider_interface_get_secrets_result (NMSecretsProviderInterface *se hash = g_hash_table_lookup (settings, name); if (!hash) { - nm_warning ("couldn't get setting secrets for '%s'", name); + nm_log_warn (LOGD_CORE, "couldn't get setting secrets for '%s'", name); continue; }