All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ctm: use ofono_error instead of DBG for errors
@ 2010-12-15 21:06 Gustavo F. Padovan
  2010-12-15 21:23 ` Neil Jerram
  2010-12-16 14:47 ` Lucas De Marchi
  0 siblings, 2 replies; 7+ messages in thread
From: Gustavo F. Padovan @ 2010-12-15 21:06 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]

---
 src/ctm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ctm.c b/src/ctm.c
index 1df34c2..2c82c2e 100644
--- a/src/ctm.c
+++ b/src/ctm.c
@@ -90,7 +90,7 @@ static void ctm_set_enabled_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error setting ctm enabled property");
+		ofono_error("Error setting ctm enabled property");
 
 		reply = __ofono_error_failed(ctm->pending);
 		__ofono_dbus_pending_reply(&ctm->pending, reply);
@@ -116,7 +116,7 @@ static void ctm_query_enabled_callback(const struct ofono_error *error,
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
 		DBusMessage *reply;
 
-		DBG("Error during ctm enabled query");
+		ofono_error("Error during ctm enabled query");
 
 		reply = __ofono_error_failed(ctm->pending);
 		__ofono_dbus_pending_reply(&ctm->pending, reply);
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ctm: use ofono_error instead of DBG for errors
  2010-12-15 21:06 [PATCH] ctm: use ofono_error instead of DBG for errors Gustavo F. Padovan
@ 2010-12-15 21:23 ` Neil Jerram
  2010-12-15 21:47   ` Gustavo F. Padovan
  2010-12-16 14:47 ` Lucas De Marchi
  1 sibling, 1 reply; 7+ messages in thread
From: Neil Jerram @ 2010-12-15 21:23 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

"Gustavo F. Padovan" <padovan@profusion.mobi> writes:

> [PATCH] ctm: use ofono_error instead of DBG for errors

I'm a newcomer to ofono, and to this list, but in general I'd hope to
see more explanation/justification of code changes than this patch
provides.  In other words, why is it better to use ofono_error instead
of DBG?

Regards,
        Neil

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ctm: use ofono_error instead of DBG for errors
  2010-12-15 21:23 ` Neil Jerram
@ 2010-12-15 21:47   ` Gustavo F. Padovan
  2010-12-15 22:00     ` Neil Jerram
  0 siblings, 1 reply; 7+ messages in thread
From: Gustavo F. Padovan @ 2010-12-15 21:47 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

Hi Neil,

* Neil Jerram <neil@ossau.uklinux.net> [2010-12-15 21:23:20 +0000]:

> "Gustavo F. Padovan" <padovan@profusion.mobi> writes:
> 
> > [PATCH] ctm: use ofono_error instead of DBG for errors
> 
> I'm a newcomer to ofono, and to this list, but in general I'd hope to
> see more explanation/justification of code changes than this patch
> provides.  In other words, why is it better to use ofono_error instead
> of DBG?

This patch fixes situation where we were reporting error in DBG messages.
If we have an error to print it is good to give the right priority to the
message. Just look the patch and you will figure out this.

-- 
Gustavo F. Padovan
http://profusion.mobi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ctm: use ofono_error instead of DBG for errors
  2010-12-15 21:47   ` Gustavo F. Padovan
@ 2010-12-15 22:00     ` Neil Jerram
  0 siblings, 0 replies; 7+ messages in thread
From: Neil Jerram @ 2010-12-15 22:00 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 358 bytes --]

"Gustavo F. Padovan" <padovan@profusion.mobi> writes:

> This patch fixes situation where we were reporting error in DBG messages.
> If we have an error to print it is good to give the right priority to the
> message. Just look the patch and you will figure out this.

OK, so it makes the message more prominent.  Thanks for explaining!

      Neil

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ctm: use ofono_error instead of DBG for errors
  2010-12-15 21:06 [PATCH] ctm: use ofono_error instead of DBG for errors Gustavo F. Padovan
  2010-12-15 21:23 ` Neil Jerram
@ 2010-12-16 14:47 ` Lucas De Marchi
  2010-12-16 18:04   ` [PATCH] " Gustavo F. Padovan
  1 sibling, 1 reply; 7+ messages in thread
From: Lucas De Marchi @ 2010-12-16 14:47 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]

On Wed, Dec 15, 2010 at 7:06 PM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
> ---
>  src/ctm.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/ctm.c b/src/ctm.c
> index 1df34c2..2c82c2e 100644
> --- a/src/ctm.c
> +++ b/src/ctm.c
> @@ -90,7 +90,7 @@ static void ctm_set_enabled_callback(const struct ofono_error *error,
>        DBusMessage *reply;
>
>        if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -               DBG("Error setting ctm enabled property");
> +               ofono_error("Error setting ctm enabled property");
>
>                reply = __ofono_error_failed(ctm->pending);
>                __ofono_dbus_pending_reply(&ctm->pending, reply);
> @@ -116,7 +116,7 @@ static void ctm_query_enabled_callback(const struct ofono_error *error,
>        if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
>                DBusMessage *reply;
>
> -               DBG("Error during ctm enabled query");
> +               ofono_error("Error during ctm enabled query");
>
>                reply = __ofono_error_failed(ctm->pending);
>                __ofono_dbus_pending_reply(&ctm->pending, reply);
> --

Then you might want to change the other similar call sites, too. Using
the following semantic patch, I hopefully found all of them:

// <smpl>
@r1@
struct ofono_error *error;
@@

if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
...
- DBG
+ ofono_error
...
}
// </smpl>


See patch attached.

regards,
Lucas De Marchi

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: use_error_log.patch --]
[-- Type: text/x-patch, Size: 15347 bytes --]

diff --git a/src/call-barring.c b/src/call-barring.c
index bb15530..95f489e 100644
--- a/src/call-barring.c
+++ b/src/call-barring.c
@@ -327,7 +327,7 @@ static void cb_ss_set_lock_callback(const struct ofono_error *error,
 	struct ofono_call_barring *cb = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Enabling/disabling Call Barring via SS failed");
+		ofono_error("Enabling/disabling Call Barring via SS failed");
 		__ofono_dbus_pending_reply(&cb->pending,
 					__ofono_error_failed(cb->pending));
 		return;
@@ -733,7 +733,7 @@ static void set_lock_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_barring *cb = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Enabling/disabling a lock failed");
+		ofono_error("Enabling/disabling a lock failed");
 		__ofono_dbus_pending_reply(&cb->pending,
 					__ofono_error_failed(cb->pending));
 		return;
@@ -883,7 +883,7 @@ static void disable_all_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_barring *cb = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Disabling all barring failed");
+		ofono_error("Disabling all barring failed");
 		__ofono_dbus_pending_reply(&cb->pending,
 					__ofono_error_failed(cb->pending));
 		return;
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index bb8aa37..9a2fd85 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -549,7 +549,7 @@ static void set_property_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during set/erasure");
+		ofono_error("Error occurred during set/erasure");
 		__ofono_dbus_pending_reply(&cf->pending,
 					__ofono_error_failed(cf->pending));
 		return;
@@ -674,7 +674,7 @@ static void disable_conditional_callback(const struct ofono_error *error,
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during conditional erasure");
+		ofono_error("Error occurred during conditional erasure");
 
 		__ofono_dbus_pending_reply(&cf->pending,
 					__ofono_error_failed(cf->pending));
@@ -692,7 +692,7 @@ static void disable_all_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during erasure of all");
+		ofono_error("Error occurred during erasure of all");
 
 		__ofono_dbus_pending_reply(&cf->pending,
 					__ofono_error_failed(cf->pending));
@@ -877,7 +877,7 @@ static void cf_ss_control_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during cf ss control set/erasure");
+		ofono_error("Error occurred during cf ss control set/erasure");
 
 		__ofono_dbus_pending_reply(&cf->pending,
 					__ofono_error_failed(cf->pending));
diff --git a/src/call-meter.c b/src/call-meter.c
index ac3ae6b..8a45d15 100644
--- a/src/call-meter.c
+++ b/src/call-meter.c
@@ -336,7 +336,7 @@ static void set_acm_max_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_meter *cm = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Setting acm_max failed");
+		ofono_error("Setting acm_max failed");
 		__ofono_dbus_pending_reply(&cm->pending,
 					__ofono_error_failed(cm->pending));
 		return;
@@ -397,7 +397,7 @@ static void set_puct_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_meter *cm = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting puct failed");
+		ofono_error("setting puct failed");
 		__ofono_dbus_pending_reply(&cm->pending,
 					__ofono_error_failed(cm->pending));
 		return;
@@ -594,7 +594,7 @@ static void acm_reset_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_meter *cm = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("reseting acm failed");
+		ofono_error("reseting acm failed");
 		__ofono_dbus_pending_reply(&cm->pending,
 					__ofono_error_failed(cm->pending));
 		return;
diff --git a/src/call-settings.c b/src/call-settings.c
index 49a7fb0..6ed85a1 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -372,7 +372,7 @@ static void cw_ss_query_callback(const struct ofono_error *error, int status,
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting CW via SS failed");
+		ofono_error("setting CW via SS failed");
 
 		cs->flags &= ~CALL_SETTINGS_FLAG_CACHED;
 		__ofono_dbus_pending_reply(&cs->pending,
@@ -391,7 +391,7 @@ static void cw_ss_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting CW via SS failed");
+		ofono_error("setting CW via SS failed");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -528,7 +528,7 @@ static void clip_colp_colr_ss_query_cb(const struct ofono_error *error,
 	const char *value;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during ss control query");
+		ofono_error("Error occurred during ss control query");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -628,7 +628,7 @@ static void clir_ss_query_callback(const struct ofono_error *error,
 	const char *value;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting clir via SS failed");
+		ofono_error("setting clir via SS failed");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -676,7 +676,7 @@ static void clir_ss_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting clir via SS failed");
+		ofono_error("setting clir via SS failed");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -1007,7 +1007,7 @@ static void clir_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting clir failed");
+		ofono_error("setting clir failed");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -1069,7 +1069,7 @@ static void cw_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during CW set");
+		ofono_error("Error occurred during CW set");
 
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
diff --git a/src/cbs.c b/src/cbs.c
index 8e4afc1..2694f56 100644
--- a/src/cbs.c
+++ b/src/cbs.c
@@ -344,7 +344,7 @@ static void cbs_set_topics_cb(const struct ofono_error *error, void *data)
 		g_slist_free(cbs->new_topics);
 		cbs->new_topics = NULL;
 
-		DBG("Setting Cell Broadcast topics failed");
+		ofono_error("Setting Cell Broadcast topics failed");
 		__ofono_dbus_pending_reply(&cbs->pending,
 					__ofono_error_failed(cbs->pending));
 		return;
diff --git a/src/ctm.c b/src/ctm.c
index 1df34c2..2c82c2e 100644
--- a/src/ctm.c
+++ b/src/ctm.c
@@ -90,7 +90,7 @@ static void ctm_set_enabled_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error setting ctm enabled property");
+		ofono_error("Error setting ctm enabled property");
 
 		reply = __ofono_error_failed(ctm->pending);
 		__ofono_dbus_pending_reply(&ctm->pending, reply);
@@ -116,7 +116,7 @@ static void ctm_query_enabled_callback(const struct ofono_error *error,
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
 		DBusMessage *reply;
 
-		DBG("Error during ctm enabled query");
+		ofono_error("Error during ctm enabled query");
 
 		reply = __ofono_error_failed(ctm->pending);
 		__ofono_dbus_pending_reply(&ctm->pending, reply);
diff --git a/src/gprs.c b/src/gprs.c
index 58166f8..d767db9 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -661,7 +661,7 @@ static void pri_activate_callback(const struct ofono_error *error,
 	DBG("%p %s", ctx, interface);
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Activating context failed with error: %s",
+		ofono_error("Activating context failed with error: %s",
 				telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&ctx->pending,
 					__ofono_error_failed(ctx->pending));
@@ -699,7 +699,7 @@ static void pri_deactivate_callback(const struct ofono_error *error, void *data)
 	dbus_bool_t value;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Deactivating context failed with error: %s",
+		ofono_error("Deactivating context failed with error: %s",
 				telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&ctx->pending,
 					__ofono_error_failed(ctx->pending));
@@ -1657,7 +1657,7 @@ static void gprs_deactivate_for_remove(const struct ofono_error *error,
 	const char *atompath;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Removing context failed with error: %s",
+		ofono_error("Removing context failed with error: %s",
 				telephony_error_to_str(error));
 
 		__ofono_dbus_pending_reply(&gprs->pending,
diff --git a/src/network.c b/src/network.c
index 95af5d4..2529819 100644
--- a/src/network.c
+++ b/src/network.c
@@ -181,7 +181,7 @@ static void registration_status_callback(const struct ofono_error *error,
 	struct ofono_netreg *netreg = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during registration status query");
+		ofono_error("Error during registration status query");
 		return;
 	}
 
@@ -1214,7 +1214,7 @@ static void current_operator_callback(const struct ofono_error *error,
 		current = NULL;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during current operator");
+		ofono_error("Error during current operator");
 		return;
 	}
 
@@ -1352,7 +1352,7 @@ static void signal_strength_callback(const struct ofono_error *error,
 	struct ofono_netreg *netreg = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during signal strength query");
+		ofono_error("Error during signal strength query");
 		return;
 	}
 
@@ -1366,7 +1366,7 @@ static void init_registration_status(const struct ofono_error *error,
 	struct ofono_netreg *netreg = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during registration status query");
+		ofono_error("Error during registration status query");
 		return;
 	}
 
diff --git a/src/radio-settings.c b/src/radio-settings.c
index 7a1f34b..bfc8f9b 100644
--- a/src/radio-settings.c
+++ b/src/radio-settings.c
@@ -251,7 +251,7 @@ static void radio_fast_dormancy_set_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error setting fast dormancy");
+		ofono_error("Error setting fast dormancy");
 
 		rs->fast_dormancy_pending = rs->fast_dormancy;
 
@@ -304,7 +304,7 @@ static void radio_band_set_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error setting radio frequency band");
+		ofono_error("Error setting radio frequency band");
 
 		rs->pending_band_gsm = rs->band_gsm;
 		rs->pending_band_umts = rs->band_umts;
@@ -348,7 +348,7 @@ static void radio_mode_set_callback(const struct ofono_error *error, void *data)
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error setting radio access mode");
+		ofono_error("Error setting radio access mode");
 
 		rs->pending_mode = rs->mode;
 
@@ -381,7 +381,7 @@ static void radio_fast_dormancy_query_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during fast dormancy query");
+		ofono_error("Error during fast dormancy query");
 
 		reply = __ofono_error_failed(rs->pending);
 		__ofono_dbus_pending_reply(&rs->pending, reply);
@@ -413,7 +413,7 @@ static void radio_band_query_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during radio frequency band query");
+		ofono_error("Error during radio frequency band query");
 
 		reply = __ofono_error_failed(rs->pending);
 		__ofono_dbus_pending_reply(&rs->pending, reply);
@@ -446,7 +446,7 @@ static void radio_rat_mode_query_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during radio access mode query");
+		ofono_error("Error during radio access mode query");
 
 		reply = __ofono_error_failed(rs->pending);
 		__ofono_dbus_pending_reply(&rs->pending, reply);
diff --git a/src/sms.c b/src/sms.c
index 163eab0..d77948c 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -576,7 +576,7 @@ static void bearer_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_sms *sms = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Setting Bearer failed");
+		ofono_error("Setting Bearer failed");
 		__ofono_dbus_pending_reply(&sms->pending,
 					__ofono_error_failed(sms->pending));
 		return;
@@ -611,7 +611,7 @@ static void sca_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_sms *sms = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Setting SCA failed");
+		ofono_error("Setting SCA failed");
 		__ofono_dbus_pending_reply(&sms->pending,
 					__ofono_error_failed(sms->pending));
 		return;
diff --git a/src/ussd.c b/src/ussd.c
index e0c89cd..97502b2 100644
--- a/src/ussd.c
+++ b/src/ussd.c
@@ -656,7 +656,7 @@ static void ussd_cancel_callback(const struct ofono_error *error, void *data)
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("ussd cancel failed with error: %s",
+		ofono_error("ussd cancel failed with error: %s",
 				telephony_error_to_str(error));
 
 		reply = __ofono_error_failed(ussd->cancel);
diff --git a/src/voicecall.c b/src/voicecall.c
index dbf3e9a..d7aef46 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -1079,7 +1079,7 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc,
 	*need_to_emit = FALSE;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Dial callback returned error: %s",
+		ofono_error("Dial callback returned error: %s",
 			telephony_error_to_str(error));
 
 		return NULL;
@@ -1398,7 +1398,7 @@ static void private_chat_callback(const struct ofono_error *error, void *data)
 	GSList *old;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("command failed with error: %s",
+		ofono_error("command failed with error: %s",
 				telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&vc->pending,
 					__ofono_error_failed(vc->pending));
@@ -1498,7 +1498,7 @@ static void multiparty_create_callback(const struct ofono_error *error,
 	GSList *old;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("command failed with error: %s",
+		ofono_error("command failed with error: %s",
 				telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&vc->pending,
 					__ofono_error_failed(vc->pending));

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] use ofono_error instead of DBG for errors
  2010-12-16 14:47 ` Lucas De Marchi
@ 2010-12-16 18:04   ` Gustavo F. Padovan
  2010-12-17 16:29     ` Denis Kenzior
  0 siblings, 1 reply; 7+ messages in thread
From: Gustavo F. Padovan @ 2010-12-16 18:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 16285 bytes --]

---
 src/call-barring.c    |    6 +++---
 src/call-forwarding.c |    8 ++++----
 src/call-meter.c      |    6 +++---
 src/call-settings.c   |   14 +++++++-------
 src/cbs.c             |    2 +-
 src/ctm.c             |    4 ++--
 src/gprs.c            |    6 +++---
 src/network.c         |    8 ++++----
 src/radio-settings.c  |   12 ++++++------
 src/sms.c             |    4 ++--
 src/ussd.c            |    2 +-
 src/voicecall.c       |    6 +++---
 12 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/src/call-barring.c b/src/call-barring.c
index bb15530..95f489e 100644
--- a/src/call-barring.c
+++ b/src/call-barring.c
@@ -327,7 +327,7 @@ static void cb_ss_set_lock_callback(const struct ofono_error *error,
 	struct ofono_call_barring *cb = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Enabling/disabling Call Barring via SS failed");
+		ofono_error("Enabling/disabling Call Barring via SS failed");
 		__ofono_dbus_pending_reply(&cb->pending,
 					__ofono_error_failed(cb->pending));
 		return;
@@ -733,7 +733,7 @@ static void set_lock_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_barring *cb = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Enabling/disabling a lock failed");
+		ofono_error("Enabling/disabling a lock failed");
 		__ofono_dbus_pending_reply(&cb->pending,
 					__ofono_error_failed(cb->pending));
 		return;
@@ -883,7 +883,7 @@ static void disable_all_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_barring *cb = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Disabling all barring failed");
+		ofono_error("Disabling all barring failed");
 		__ofono_dbus_pending_reply(&cb->pending,
 					__ofono_error_failed(cb->pending));
 		return;
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index bb8aa37..9a2fd85 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -549,7 +549,7 @@ static void set_property_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during set/erasure");
+		ofono_error("Error occurred during set/erasure");
 		__ofono_dbus_pending_reply(&cf->pending,
 					__ofono_error_failed(cf->pending));
 		return;
@@ -674,7 +674,7 @@ static void disable_conditional_callback(const struct ofono_error *error,
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during conditional erasure");
+		ofono_error("Error occurred during conditional erasure");
 
 		__ofono_dbus_pending_reply(&cf->pending,
 					__ofono_error_failed(cf->pending));
@@ -692,7 +692,7 @@ static void disable_all_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during erasure of all");
+		ofono_error("Error occurred during erasure of all");
 
 		__ofono_dbus_pending_reply(&cf->pending,
 					__ofono_error_failed(cf->pending));
@@ -877,7 +877,7 @@ static void cf_ss_control_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during cf ss control set/erasure");
+		ofono_error("Error occurred during cf ss control set/erasure");
 
 		__ofono_dbus_pending_reply(&cf->pending,
 					__ofono_error_failed(cf->pending));
diff --git a/src/call-meter.c b/src/call-meter.c
index ac3ae6b..8a45d15 100644
--- a/src/call-meter.c
+++ b/src/call-meter.c
@@ -336,7 +336,7 @@ static void set_acm_max_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_meter *cm = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Setting acm_max failed");
+		ofono_error("Setting acm_max failed");
 		__ofono_dbus_pending_reply(&cm->pending,
 					__ofono_error_failed(cm->pending));
 		return;
@@ -397,7 +397,7 @@ static void set_puct_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_meter *cm = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting puct failed");
+		ofono_error("setting puct failed");
 		__ofono_dbus_pending_reply(&cm->pending,
 					__ofono_error_failed(cm->pending));
 		return;
@@ -594,7 +594,7 @@ static void acm_reset_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_meter *cm = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("reseting acm failed");
+		ofono_error("reseting acm failed");
 		__ofono_dbus_pending_reply(&cm->pending,
 					__ofono_error_failed(cm->pending));
 		return;
diff --git a/src/call-settings.c b/src/call-settings.c
index 49a7fb0..6ed85a1 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -372,7 +372,7 @@ static void cw_ss_query_callback(const struct ofono_error *error, int status,
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting CW via SS failed");
+		ofono_error("setting CW via SS failed");
 
 		cs->flags &= ~CALL_SETTINGS_FLAG_CACHED;
 		__ofono_dbus_pending_reply(&cs->pending,
@@ -391,7 +391,7 @@ static void cw_ss_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting CW via SS failed");
+		ofono_error("setting CW via SS failed");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -528,7 +528,7 @@ static void clip_colp_colr_ss_query_cb(const struct ofono_error *error,
 	const char *value;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during ss control query");
+		ofono_error("Error occurred during ss control query");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -628,7 +628,7 @@ static void clir_ss_query_callback(const struct ofono_error *error,
 	const char *value;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting clir via SS failed");
+		ofono_error("setting clir via SS failed");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -676,7 +676,7 @@ static void clir_ss_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting clir via SS failed");
+		ofono_error("setting clir via SS failed");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -1007,7 +1007,7 @@ static void clir_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting clir failed");
+		ofono_error("setting clir failed");
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
 
@@ -1069,7 +1069,7 @@ static void cw_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during CW set");
+		ofono_error("Error occurred during CW set");
 
 		__ofono_dbus_pending_reply(&cs->pending,
 					__ofono_error_failed(cs->pending));
diff --git a/src/cbs.c b/src/cbs.c
index 8e4afc1..2694f56 100644
--- a/src/cbs.c
+++ b/src/cbs.c
@@ -344,7 +344,7 @@ static void cbs_set_topics_cb(const struct ofono_error *error, void *data)
 		g_slist_free(cbs->new_topics);
 		cbs->new_topics = NULL;
 
-		DBG("Setting Cell Broadcast topics failed");
+		ofono_error("Setting Cell Broadcast topics failed");
 		__ofono_dbus_pending_reply(&cbs->pending,
 					__ofono_error_failed(cbs->pending));
 		return;
diff --git a/src/ctm.c b/src/ctm.c
index 1df34c2..2c82c2e 100644
--- a/src/ctm.c
+++ b/src/ctm.c
@@ -90,7 +90,7 @@ static void ctm_set_enabled_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error setting ctm enabled property");
+		ofono_error("Error setting ctm enabled property");
 
 		reply = __ofono_error_failed(ctm->pending);
 		__ofono_dbus_pending_reply(&ctm->pending, reply);
@@ -116,7 +116,7 @@ static void ctm_query_enabled_callback(const struct ofono_error *error,
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
 		DBusMessage *reply;
 
-		DBG("Error during ctm enabled query");
+		ofono_error("Error during ctm enabled query");
 
 		reply = __ofono_error_failed(ctm->pending);
 		__ofono_dbus_pending_reply(&ctm->pending, reply);
diff --git a/src/gprs.c b/src/gprs.c
index 58166f8..d767db9 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -661,7 +661,7 @@ static void pri_activate_callback(const struct ofono_error *error,
 	DBG("%p %s", ctx, interface);
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Activating context failed with error: %s",
+		ofono_error("Activating context failed with error: %s",
 				telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&ctx->pending,
 					__ofono_error_failed(ctx->pending));
@@ -699,7 +699,7 @@ static void pri_deactivate_callback(const struct ofono_error *error, void *data)
 	dbus_bool_t value;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Deactivating context failed with error: %s",
+		ofono_error("Deactivating context failed with error: %s",
 				telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&ctx->pending,
 					__ofono_error_failed(ctx->pending));
@@ -1657,7 +1657,7 @@ static void gprs_deactivate_for_remove(const struct ofono_error *error,
 	const char *atompath;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Removing context failed with error: %s",
+		ofono_error("Removing context failed with error: %s",
 				telephony_error_to_str(error));
 
 		__ofono_dbus_pending_reply(&gprs->pending,
diff --git a/src/network.c b/src/network.c
index 95af5d4..2529819 100644
--- a/src/network.c
+++ b/src/network.c
@@ -181,7 +181,7 @@ static void registration_status_callback(const struct ofono_error *error,
 	struct ofono_netreg *netreg = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during registration status query");
+		ofono_error("Error during registration status query");
 		return;
 	}
 
@@ -1214,7 +1214,7 @@ static void current_operator_callback(const struct ofono_error *error,
 		current = NULL;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during current operator");
+		ofono_error("Error during current operator");
 		return;
 	}
 
@@ -1352,7 +1352,7 @@ static void signal_strength_callback(const struct ofono_error *error,
 	struct ofono_netreg *netreg = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during signal strength query");
+		ofono_error("Error during signal strength query");
 		return;
 	}
 
@@ -1366,7 +1366,7 @@ static void init_registration_status(const struct ofono_error *error,
 	struct ofono_netreg *netreg = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during registration status query");
+		ofono_error("Error during registration status query");
 		return;
 	}
 
diff --git a/src/radio-settings.c b/src/radio-settings.c
index 7a1f34b..bfc8f9b 100644
--- a/src/radio-settings.c
+++ b/src/radio-settings.c
@@ -251,7 +251,7 @@ static void radio_fast_dormancy_set_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error setting fast dormancy");
+		ofono_error("Error setting fast dormancy");
 
 		rs->fast_dormancy_pending = rs->fast_dormancy;
 
@@ -304,7 +304,7 @@ static void radio_band_set_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error setting radio frequency band");
+		ofono_error("Error setting radio frequency band");
 
 		rs->pending_band_gsm = rs->band_gsm;
 		rs->pending_band_umts = rs->band_umts;
@@ -348,7 +348,7 @@ static void radio_mode_set_callback(const struct ofono_error *error, void *data)
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error setting radio access mode");
+		ofono_error("Error setting radio access mode");
 
 		rs->pending_mode = rs->mode;
 
@@ -381,7 +381,7 @@ static void radio_fast_dormancy_query_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during fast dormancy query");
+		ofono_error("Error during fast dormancy query");
 
 		reply = __ofono_error_failed(rs->pending);
 		__ofono_dbus_pending_reply(&rs->pending, reply);
@@ -413,7 +413,7 @@ static void radio_band_query_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during radio frequency band query");
+		ofono_error("Error during radio frequency band query");
 
 		reply = __ofono_error_failed(rs->pending);
 		__ofono_dbus_pending_reply(&rs->pending, reply);
@@ -446,7 +446,7 @@ static void radio_rat_mode_query_callback(const struct ofono_error *error,
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error during radio access mode query");
+		ofono_error("Error during radio access mode query");
 
 		reply = __ofono_error_failed(rs->pending);
 		__ofono_dbus_pending_reply(&rs->pending, reply);
diff --git a/src/sms.c b/src/sms.c
index 163eab0..d77948c 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -576,7 +576,7 @@ static void bearer_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_sms *sms = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Setting Bearer failed");
+		ofono_error("Setting Bearer failed");
 		__ofono_dbus_pending_reply(&sms->pending,
 					__ofono_error_failed(sms->pending));
 		return;
@@ -611,7 +611,7 @@ static void sca_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_sms *sms = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Setting SCA failed");
+		ofono_error("Setting SCA failed");
 		__ofono_dbus_pending_reply(&sms->pending,
 					__ofono_error_failed(sms->pending));
 		return;
diff --git a/src/ussd.c b/src/ussd.c
index e0c89cd..97502b2 100644
--- a/src/ussd.c
+++ b/src/ussd.c
@@ -656,7 +656,7 @@ static void ussd_cancel_callback(const struct ofono_error *error, void *data)
 	DBusMessage *reply;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("ussd cancel failed with error: %s",
+		ofono_error("ussd cancel failed with error: %s",
 				telephony_error_to_str(error));
 
 		reply = __ofono_error_failed(ussd->cancel);
diff --git a/src/voicecall.c b/src/voicecall.c
index dbf3e9a..d7aef46 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -1079,7 +1079,7 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc,
 	*need_to_emit = FALSE;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Dial callback returned error: %s",
+		ofono_error("Dial callback returned error: %s",
 			telephony_error_to_str(error));
 
 		return NULL;
@@ -1398,7 +1398,7 @@ static void private_chat_callback(const struct ofono_error *error, void *data)
 	GSList *old;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("command failed with error: %s",
+		ofono_error("command failed with error: %s",
 				telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&vc->pending,
 					__ofono_error_failed(vc->pending));
@@ -1498,7 +1498,7 @@ static void multiparty_create_callback(const struct ofono_error *error,
 	GSList *old;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("command failed with error: %s",
+		ofono_error("command failed with error: %s",
 				telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&vc->pending,
 					__ofono_error_failed(vc->pending));
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] use ofono_error instead of DBG for errors
  2010-12-16 18:04   ` [PATCH] " Gustavo F. Padovan
@ 2010-12-17 16:29     ` Denis Kenzior
  0 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2010-12-17 16:29 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 18080 bytes --]

Hi Gustavo,

On 12/16/2010 12:04 PM, Gustavo F. Padovan wrote:
> ---
>  src/call-barring.c    |    6 +++---
>  src/call-forwarding.c |    8 ++++----
>  src/call-meter.c      |    6 +++---
>  src/call-settings.c   |   14 +++++++-------
>  src/cbs.c             |    2 +-
>  src/ctm.c             |    4 ++--
>  src/gprs.c            |    6 +++---
>  src/network.c         |    8 ++++----
>  src/radio-settings.c  |   12 ++++++------
>  src/sms.c             |    4 ++--
>  src/ussd.c            |    2 +-
>  src/voicecall.c       |    6 +++---
>  12 files changed, 39 insertions(+), 39 deletions(-)
> 

Actually some of these should be DBG and not ofono_error.  In many of
these cases the input depends on the user (e.g. having the right
password, etc) so reporting an error is the wrong thing to do.  In other
cases the error depends on the network state, etc.

> diff --git a/src/call-barring.c b/src/call-barring.c
> index bb15530..95f489e 100644
> --- a/src/call-barring.c
> +++ b/src/call-barring.c
> @@ -327,7 +327,7 @@ static void cb_ss_set_lock_callback(const struct ofono_error *error,
>  	struct ofono_call_barring *cb = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Enabling/disabling Call Barring via SS failed");
> +		ofono_error("Enabling/disabling Call Barring via SS failed");
>  		__ofono_dbus_pending_reply(&cb->pending,
>  					__ofono_error_failed(cb->pending));
>  		return;

For instance, this one requires PIN2

> @@ -733,7 +733,7 @@ static void set_lock_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_barring *cb = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Enabling/disabling a lock failed");
> +		ofono_error("Enabling/disabling a lock failed");
>  		__ofono_dbus_pending_reply(&cb->pending,
>  					__ofono_error_failed(cb->pending));
>  		return;

Same as above

> @@ -883,7 +883,7 @@ static void disable_all_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_barring *cb = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Disabling all barring failed");
> +		ofono_error("Disabling all barring failed");
>  		__ofono_dbus_pending_reply(&cb->pending,
>  					__ofono_error_failed(cb->pending));

And here

>  		return;
> diff --git a/src/call-forwarding.c b/src/call-forwarding.c
> index bb8aa37..9a2fd85 100644
> --- a/src/call-forwarding.c
> +++ b/src/call-forwarding.c
> @@ -549,7 +549,7 @@ static void set_property_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_forwarding *cf = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error occurred during set/erasure");
> +		ofono_error("Error occurred during set/erasure");
>  		__ofono_dbus_pending_reply(&cf->pending,
>  					__ofono_error_failed(cf->pending));
>  		return;
> @@ -674,7 +674,7 @@ static void disable_conditional_callback(const struct ofono_error *error,
>  	struct ofono_call_forwarding *cf = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error occurred during conditional erasure");
> +		ofono_error("Error occurred during conditional erasure");
>  
>  		__ofono_dbus_pending_reply(&cf->pending,
>  					__ofono_error_failed(cf->pending));
> @@ -692,7 +692,7 @@ static void disable_all_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_forwarding *cf = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error occurred during erasure of all");
> +		ofono_error("Error occurred during erasure of all");
>  
>  		__ofono_dbus_pending_reply(&cf->pending,
>  					__ofono_error_failed(cf->pending));
> @@ -877,7 +877,7 @@ static void cf_ss_control_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_forwarding *cf = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error occurred during cf ss control set/erasure");
> +		ofono_error("Error occurred during cf ss control set/erasure");
>  
>  		__ofono_dbus_pending_reply(&cf->pending,
>  					__ofono_error_failed(cf->pending));

These depend on the network state and can fail...

> diff --git a/src/call-meter.c b/src/call-meter.c
> index ac3ae6b..8a45d15 100644
> --- a/src/call-meter.c
> +++ b/src/call-meter.c
> @@ -336,7 +336,7 @@ static void set_acm_max_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_meter *cm = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Setting acm_max failed");
> +		ofono_error("Setting acm_max failed");
>  		__ofono_dbus_pending_reply(&cm->pending,
>  					__ofono_error_failed(cm->pending));
>  		return;
> @@ -397,7 +397,7 @@ static void set_puct_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_meter *cm = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("setting puct failed");
> +		ofono_error("setting puct failed");
>  		__ofono_dbus_pending_reply(&cm->pending,
>  					__ofono_error_failed(cm->pending));
>  		return;
> @@ -594,7 +594,7 @@ static void acm_reset_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_meter *cm = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("reseting acm failed");
> +		ofono_error("reseting acm failed");
>  		__ofono_dbus_pending_reply(&cm->pending,
>  					__ofono_error_failed(cm->pending));
>  		return;

All these require PIN2

> diff --git a/src/call-settings.c b/src/call-settings.c
> index 49a7fb0..6ed85a1 100644
> --- a/src/call-settings.c
> +++ b/src/call-settings.c
> @@ -372,7 +372,7 @@ static void cw_ss_query_callback(const struct ofono_error *error, int status,
>  	struct ofono_call_settings *cs = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("setting CW via SS failed");
> +		ofono_error("setting CW via SS failed");
>  
>  		cs->flags &= ~CALL_SETTINGS_FLAG_CACHED;
>  		__ofono_dbus_pending_reply(&cs->pending,
> @@ -391,7 +391,7 @@ static void cw_ss_set_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_settings *cs = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("setting CW via SS failed");
> +		ofono_error("setting CW via SS failed");
>  		__ofono_dbus_pending_reply(&cs->pending,
>  					__ofono_error_failed(cs->pending));
>  
> @@ -528,7 +528,7 @@ static void clip_colp_colr_ss_query_cb(const struct ofono_error *error,
>  	const char *value;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error occurred during ss control query");
> +		ofono_error("Error occurred during ss control query");
>  		__ofono_dbus_pending_reply(&cs->pending,
>  					__ofono_error_failed(cs->pending));
>  
> @@ -628,7 +628,7 @@ static void clir_ss_query_callback(const struct ofono_error *error,
>  	const char *value;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("setting clir via SS failed");
> +		ofono_error("setting clir via SS failed");
>  		__ofono_dbus_pending_reply(&cs->pending,
>  					__ofono_error_failed(cs->pending));
>  
> @@ -676,7 +676,7 @@ static void clir_ss_set_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_settings *cs = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("setting clir via SS failed");
> +		ofono_error("setting clir via SS failed");
>  		__ofono_dbus_pending_reply(&cs->pending,
>  					__ofono_error_failed(cs->pending));
>  
> @@ -1007,7 +1007,7 @@ static void clir_set_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_settings *cs = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("setting clir failed");
> +		ofono_error("setting clir failed");
>  		__ofono_dbus_pending_reply(&cs->pending,
>  					__ofono_error_failed(cs->pending));
>  
> @@ -1069,7 +1069,7 @@ static void cw_set_callback(const struct ofono_error *error, void *data)
>  	struct ofono_call_settings *cs = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error occurred during CW set");
> +		ofono_error("Error occurred during CW set");
>  
>  		__ofono_dbus_pending_reply(&cs->pending,
>  					__ofono_error_failed(cs->pending));

These can all depend on the network state..

> diff --git a/src/cbs.c b/src/cbs.c
> index 8e4afc1..2694f56 100644
> --- a/src/cbs.c
> +++ b/src/cbs.c
> @@ -344,7 +344,7 @@ static void cbs_set_topics_cb(const struct ofono_error *error, void *data)
>  		g_slist_free(cbs->new_topics);
>  		cbs->new_topics = NULL;
>  
> -		DBG("Setting Cell Broadcast topics failed");
> +		ofono_error("Setting Cell Broadcast topics failed");
>  		__ofono_dbus_pending_reply(&cbs->pending,
>  					__ofono_error_failed(cbs->pending));
>  		return;

This one is probably valid

> diff --git a/src/ctm.c b/src/ctm.c
> index 1df34c2..2c82c2e 100644
> --- a/src/ctm.c
> +++ b/src/ctm.c
> @@ -90,7 +90,7 @@ static void ctm_set_enabled_callback(const struct ofono_error *error,
>  	DBusMessage *reply;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error setting ctm enabled property");
> +		ofono_error("Error setting ctm enabled property");
>  
>  		reply = __ofono_error_failed(ctm->pending);
>  		__ofono_dbus_pending_reply(&ctm->pending, reply);
> @@ -116,7 +116,7 @@ static void ctm_query_enabled_callback(const struct ofono_error *error,
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
>  		DBusMessage *reply;
>  
> -		DBG("Error during ctm enabled query");
> +		ofono_error("Error during ctm enabled query");
>  
>  		reply = __ofono_error_failed(ctm->pending);
>  		__ofono_dbus_pending_reply(&ctm->pending, reply);

And these ones as well

> diff --git a/src/gprs.c b/src/gprs.c
> index 58166f8..d767db9 100644
> --- a/src/gprs.c
> +++ b/src/gprs.c
> @@ -661,7 +661,7 @@ static void pri_activate_callback(const struct ofono_error *error,
>  	DBG("%p %s", ctx, interface);
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Activating context failed with error: %s",
> +		ofono_error("Activating context failed with error: %s",
>  				telephony_error_to_str(error));
>  		__ofono_dbus_pending_reply(&ctx->pending,
>  					__ofono_error_failed(ctx->pending));

This one can fail, e.g. invalid username / password

> @@ -699,7 +699,7 @@ static void pri_deactivate_callback(const struct ofono_error *error, void *data)
>  	dbus_bool_t value;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Deactivating context failed with error: %s",
> +		ofono_error("Deactivating context failed with error: %s",
>  				telephony_error_to_str(error));
>  		__ofono_dbus_pending_reply(&ctx->pending,
>  					__ofono_error_failed(ctx->pending));
> @@ -1657,7 +1657,7 @@ static void gprs_deactivate_for_remove(const struct ofono_error *error,
>  	const char *atompath;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Removing context failed with error: %s",
> +		ofono_error("Removing context failed with error: %s",
>  				telephony_error_to_str(error));
>  
>  		__ofono_dbus_pending_reply(&gprs->pending,

Rest are probably valid

> diff --git a/src/network.c b/src/network.c
> index 95af5d4..2529819 100644
> --- a/src/network.c
> +++ b/src/network.c
> @@ -181,7 +181,7 @@ static void registration_status_callback(const struct ofono_error *error,
>  	struct ofono_netreg *netreg = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error during registration status query");
> +		ofono_error("Error during registration status query");
>  		return;
>  	}
>  
> @@ -1214,7 +1214,7 @@ static void current_operator_callback(const struct ofono_error *error,
>  		current = NULL;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error during current operator");
> +		ofono_error("Error during current operator");
>  		return;
>  	}
>  
> @@ -1352,7 +1352,7 @@ static void signal_strength_callback(const struct ofono_error *error,
>  	struct ofono_netreg *netreg = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error during signal strength query");
> +		ofono_error("Error during signal strength query");
>  		return;
>  	}
>  
> @@ -1366,7 +1366,7 @@ static void init_registration_status(const struct ofono_error *error,
>  	struct ofono_netreg *netreg = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error during registration status query");
> +		ofono_error("Error during registration status query");
>  		return;
>  	}
>  

I'm fine with these being changed

> diff --git a/src/radio-settings.c b/src/radio-settings.c
> index 7a1f34b..bfc8f9b 100644
> --- a/src/radio-settings.c
> +++ b/src/radio-settings.c
> @@ -251,7 +251,7 @@ static void radio_fast_dormancy_set_callback(const struct ofono_error *error,
>  	DBusMessage *reply;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error setting fast dormancy");
> +		ofono_error("Error setting fast dormancy");
>  
>  		rs->fast_dormancy_pending = rs->fast_dormancy;
>  
> @@ -304,7 +304,7 @@ static void radio_band_set_callback(const struct ofono_error *error,
>  	DBusMessage *reply;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error setting radio frequency band");
> +		ofono_error("Error setting radio frequency band");
>  
>  		rs->pending_band_gsm = rs->band_gsm;
>  		rs->pending_band_umts = rs->band_umts;
> @@ -348,7 +348,7 @@ static void radio_mode_set_callback(const struct ofono_error *error, void *data)
>  	DBusMessage *reply;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error setting radio access mode");
> +		ofono_error("Error setting radio access mode");
>  
>  		rs->pending_mode = rs->mode;
>  
> @@ -381,7 +381,7 @@ static void radio_fast_dormancy_query_callback(const struct ofono_error *error,
>  	DBusMessage *reply;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error during fast dormancy query");
> +		ofono_error("Error during fast dormancy query");
>  
>  		reply = __ofono_error_failed(rs->pending);
>  		__ofono_dbus_pending_reply(&rs->pending, reply);
> @@ -413,7 +413,7 @@ static void radio_band_query_callback(const struct ofono_error *error,
>  	DBusMessage *reply;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error during radio frequency band query");
> +		ofono_error("Error during radio frequency band query");
>  
>  		reply = __ofono_error_failed(rs->pending);
>  		__ofono_dbus_pending_reply(&rs->pending, reply);
> @@ -446,7 +446,7 @@ static void radio_rat_mode_query_callback(const struct ofono_error *error,
>  	DBusMessage *reply;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Error during radio access mode query");
> +		ofono_error("Error during radio access mode query");
>  
>  		reply = __ofono_error_failed(rs->pending);
>  		__ofono_dbus_pending_reply(&rs->pending, reply);

I'm fine with the above since they're local queries, not going to the
network.

> diff --git a/src/sms.c b/src/sms.c
> index 163eab0..d77948c 100644
> --- a/src/sms.c
> +++ b/src/sms.c
> @@ -576,7 +576,7 @@ static void bearer_set_callback(const struct ofono_error *error, void *data)
>  	struct ofono_sms *sms = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Setting Bearer failed");
> +		ofono_error("Setting Bearer failed");
>  		__ofono_dbus_pending_reply(&sms->pending,
>  					__ofono_error_failed(sms->pending));

This one is valid

>  		return;
> @@ -611,7 +611,7 @@ static void sca_set_callback(const struct ofono_error *error, void *data)
>  	struct ofono_sms *sms = data;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Setting SCA failed");
> +		ofono_error("Setting SCA failed");
>  		__ofono_dbus_pending_reply(&sms->pending,
>  					__ofono_error_failed(sms->pending));

This one is valid

>  		return;
> diff --git a/src/ussd.c b/src/ussd.c
> index e0c89cd..97502b2 100644
> --- a/src/ussd.c
> +++ b/src/ussd.c
> @@ -656,7 +656,7 @@ static void ussd_cancel_callback(const struct ofono_error *error, void *data)
>  	DBusMessage *reply;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("ussd cancel failed with error: %s",
> +		ofono_error("ussd cancel failed with error: %s",
>  				telephony_error_to_str(error));

This one is valid

>  
>  		reply = __ofono_error_failed(ussd->cancel);
> diff --git a/src/voicecall.c b/src/voicecall.c
> index dbf3e9a..d7aef46 100644
> --- a/src/voicecall.c
> +++ b/src/voicecall.c
> @@ -1079,7 +1079,7 @@ static struct voicecall *dial_handle_result(struct ofono_voicecall *vc,
>  	*need_to_emit = FALSE;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("Dial callback returned error: %s",
> +		ofono_error("Dial callback returned error: %s",
>  			telephony_error_to_str(error));
>  
>  		return NULL;
> @@ -1398,7 +1398,7 @@ static void private_chat_callback(const struct ofono_error *error, void *data)
>  	GSList *old;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("command failed with error: %s",
> +		ofono_error("command failed with error: %s",
>  				telephony_error_to_str(error));
>  		__ofono_dbus_pending_reply(&vc->pending,
>  					__ofono_error_failed(vc->pending));
> @@ -1498,7 +1498,7 @@ static void multiparty_create_callback(const struct ofono_error *error,
>  	GSList *old;
>  
>  	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
> -		DBG("command failed with error: %s",
> +		ofono_error("command failed with error: %s",
>  				telephony_error_to_str(error));
>  		__ofono_dbus_pending_reply(&vc->pending,
>  					__ofono_error_failed(vc->pending));

These can all fail due to network conditions, and should not really be
printed.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-17 16:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-15 21:06 [PATCH] ctm: use ofono_error instead of DBG for errors Gustavo F. Padovan
2010-12-15 21:23 ` Neil Jerram
2010-12-15 21:47   ` Gustavo F. Padovan
2010-12-15 22:00     ` Neil Jerram
2010-12-16 14:47 ` Lucas De Marchi
2010-12-16 18:04   ` [PATCH] " Gustavo F. Padovan
2010-12-17 16:29     ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.