[asterisk-commits] sorcery/realtime: Add a bit of debug and warning messages fo... (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 2 08:02:01 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: sorcery/realtime: Add a bit of debug and warning messages for bad configs
......................................................................


sorcery/realtime: Add a bit of debug and warning messages for bad configs

When a mapping does not exist between a sorcery.conf defined object and
a realtime mapping in extconf, currently, the user will receive a slew
of ERROR messages that don't really tell what is happening. Some ERROR
messages may even be misleading, as they occur after the sorcery API has
already given up on the attempt to load and create the sorcery object.

This patch adds a bit of debug and a useful WARNING message for when a
wizard's open callback fails for a particular object type. In the bad
configurations that resulted in this patch, this provided a 'root cause'
WARNING message that pointed in the right direction of the configuration
problem.

Change-Id: I1cc7344f2b015b8b9c85a7e6ebc8cb4753a8f80b
---
M main/config.c
M main/sorcery.c
2 files changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Matt Jordan: Looks good to me, approved; Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/main/config.c b/main/config.c
index f59e121..7484b66 100644
--- a/main/config.c
+++ b/main/config.c
@@ -2869,6 +2869,7 @@
 			return 1;
 		}
 	}
+	ast_debug(5, "Failed to find a realtime mapping for %s\n", family);
 
 	return 0;
 }
diff --git a/main/sorcery.c b/main/sorcery.c
index 063e8c4..af812ad 100644
--- a/main/sorcery.c
+++ b/main/sorcery.c
@@ -991,7 +991,11 @@
 		}
 	}
 
+	ast_debug(5, "Calling wizard %s open callback on object type %s\n",
+		name, object_type->name);
 	if (wizard->callbacks.open && !(object_wizard->data = wizard->callbacks.open(data))) {
+		ast_log(LOG_WARNING, "Wizard '%s' failed to open mapping for object type '%s' with data: %s\n",
+			name, object_type->name, S_OR(data, ""));
 		AST_VECTOR_RW_UNLOCK(&object_type->wizards);
 		return AST_SORCERY_APPLY_FAIL;
 	}

-- 
To view, visit https://gerrit.asterisk.org/753
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1cc7344f2b015b8b9c85a7e6ebc8cb4753a8f80b
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list