device: remove debug logging from is_available()
Having logging statements in a simple getter (or is_*()) means you cannot call these functions without cluttering the log. Another approach would be to add an @out_reason argument, and callers who actually care log the reason. For now, just get rid of the messages.
This commit is contained in:
@@ -1142,22 +1142,16 @@ is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
||||
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
|
||||
guint32 state;
|
||||
|
||||
if (!priv->enabled) {
|
||||
_LOGD (LOGD_WIFI, "not available because not enabled");
|
||||
if (!priv->enabled)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!priv->sup_iface) {
|
||||
_LOGD (LOGD_WIFI, "not available because supplicant not running");
|
||||
if (!priv->sup_iface)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
state = nm_supplicant_interface_get_state (priv->sup_iface);
|
||||
if ( state < NM_SUPPLICANT_INTERFACE_STATE_READY
|
||||
|| state > NM_SUPPLICANT_INTERFACE_STATE_COMPLETED) {
|
||||
_LOGD (LOGD_WIFI, "not available because supplicant interface not ready");
|
||||
|| state > NM_SUPPLICANT_INTERFACE_STATE_COMPLETED)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -491,27 +491,18 @@ static gboolean
|
||||
is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
||||
{
|
||||
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (device);
|
||||
const char *iface = nm_device_get_iface (device);
|
||||
|
||||
if (!priv->enabled) {
|
||||
nm_log_dbg (LOGD_WIMAX, "(%s): not available because not enabled", iface);
|
||||
if (!priv->enabled)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!priv->wimaxd_enabled) {
|
||||
nm_log_dbg (LOGD_WIMAX, "(%s): not available because not enabled in wimaxd", iface);
|
||||
if (!priv->wimaxd_enabled)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!nm_wimax_util_sdk_is_initialized ()) {
|
||||
nm_log_dbg (LOGD_WIMAX, "(%s): not available because WiMAX SDK not initialized", iface);
|
||||
if (!nm_wimax_util_sdk_is_initialized ())
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!priv->sdk) {
|
||||
nm_log_dbg (LOGD_WIMAX, "(%s): not available because not known to WiMAX SDK", iface);
|
||||
if (!priv->sdk)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return iwmxsdk_status_get (priv->sdk) >= WIMAX_API_DEVICE_STATUS_Ready;
|
||||
}
|
||||
|
@@ -587,21 +587,16 @@ static gboolean
|
||||
is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
|
||||
{
|
||||
NMDeviceModem *self = NM_DEVICE_MODEM (device);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (device);
|
||||
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (self);
|
||||
NMModemState modem_state;
|
||||
|
||||
if (!priv->rf_enabled) {
|
||||
_LOGD (LOGD_MB, "not available because WWAN airplane mode is on");
|
||||
if (!priv->rf_enabled)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_assert (priv->modem);
|
||||
modem_state = nm_modem_get_state (priv->modem);
|
||||
if (modem_state <= NM_MODEM_STATE_INITIALIZING) {
|
||||
_LOGD (LOGD_MB, "not available because modem is not ready (%s)",
|
||||
nm_modem_state_to_string (modem_state));
|
||||
if (modem_state <= NM_MODEM_STATE_INITIALIZING)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user