[svn-commits] twilson: branch twilson/config_work r362139 - /team/twilson/config_work/main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Apr 14 09:34:33 CDT 2012


Author: twilson
Date: Sat Apr 14 09:34:29 2012
New Revision: 362139

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=362139
Log:
Add some error messages

Modified:
    team/twilson/config_work/main/config_options.c

Modified: team/twilson/config_work/main/config_options.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/main/config_options.c?view=diff&rev=362139&r1=362138&r2=362139
==============================================================================
--- team/twilson/config_work/main/config_options.c (original)
+++ team/twilson/config_work/main/config_options.c Sat Apr 14 09:34:29 2012
@@ -301,18 +301,18 @@
 	/* if type == GLOBAL_OBJ, set defaults and configure the cached cfg object */
 	if (obj->type == GLOBAL_OBJ && obj->new_global_cfg) {
 		if (aco_set_defaults(info->opts, cat, obj->new_global_cfg)) {
-			ast_log(LOG_NOTICE, "3\n");
+			ast_log(LOG_ERROR, "In %s: Setting defaults for %s failed\n", info->filename, cat);
 			return -1;
 		}
 		if (aco_process_category_options(info->opts, cfg, cat, obj->new_global_cfg)) {
-			ast_log(LOG_NOTICE, "4\n");
+			ast_log(LOG_ERROR, "In %s: Processing options for %s failed\n", info->filename, cat);
 			return -1;
 		}
 	} else if (obj->type == PRIVATE_OBJ) {
 		/* If we've already linked a private for cat in newpvts, don't add a second one with the same name */
 		if (obj->new_pvts) {
 			if ((tmppvt = obj->find_pvt(obj->new_pvts, cat))) {
-				ast_log(LOG_NOTICE, "5\n");
+				ast_log(LOG_ERROR, "In %s: Multiple definitions of %s!\n", info->filename, cat);
 				return -1;
 			}
 
@@ -320,43 +320,43 @@
 			if (!(tmppvt = obj->find_or_create_pvt(cat))) {
 				/* Since we will be replacing the whole private container, bail out on errors instead of just
 				 * skipping privates with config errors */
-				ast_log(LOG_WARNING, "Could not create pvt '%s,' ignoring all private config changes.\n", cat);
+				ast_log(LOG_ERROR, "In %s: Could not create private object for %s\n", info->filename, cat);
 				return -1;
 			}
 		}
 
 		if (!(tmpcfg = obj->cfg_alloc(cat))) {
-			ast_log(LOG_NOTICE, "6\n");
+			ast_log(LOG_ERROR, "In %s: Could not create private config object for %s\n", info->filename, cat);
 			return -1;
 		}
 
 		if (aco_set_defaults(info->opts, cat, tmpcfg)) {
-			ast_log(LOG_NOTICE, "7\n");
+			ast_log(LOG_ERROR, "In %s: Setting defaults for %s failed\n", info->filename, cat);
 			return -1;
 		}
 
 		if (obj->post_cfg_init && obj->post_cfg_init(tmpcfg)) {
-			ast_log(LOG_NOTICE, "8\n");
+			ast_log(LOG_ERROR, "In %s: Post-init callback for %s failed\n", info->filename, cat);
 			return -1;
 		}
 
 		if (aco_process_category_options(info->opts, cfg, cat, tmpcfg)) {
-			ast_log(LOG_NOTICE, "9\n");
+			ast_log(LOG_ERROR, "In %s: Processing options for %s failed\n", info->filename, cat);
 			return -1;
 		}
 
 		if (obj->prelink && obj->prelink(tmpcfg)) {
-			ast_log(LOG_NOTICE, "10\n");
+			ast_log(LOG_ERROR, "In %s: Pre-link callback for %s failed\n", info->filename, cat);
 			return -1;
 		}
 
 		/* We have a valid pvt/cfg, link 'em */
 		if (tmppvt && !ao2_link(obj->new_pvts, tmppvt)) {
-			ast_log(LOG_NOTICE, "11\n");
+			ast_log(LOG_ERROR, "In %s: Linking private for %s failed\n", info->filename, cat);
 			return -1;
 		}
 		if (!ao2_link(obj->new_cfgs, tmpcfg)) {
-			ast_log(LOG_NOTICE, "12\n");
+			ast_log(LOG_ERROR, "In %s: Linking config for %s failed\n", info->filename, cat);
 			return -1;
 		}
 	}
@@ -393,7 +393,7 @@
 
 	if (err) {
 		ao2_callback(info->objs, OBJ_NODATA, cleanup_temp_objects, NULL);
-		ast_log(LOG_NOTICE, "1\n");
+		ast_log(LOG_ERROR, "In %s: Could not allocate temporary objects\n", info->filename);
 		goto error;
 	}
 
@@ -432,7 +432,7 @@
 	for (var = ast_variable_browse(cfg, cat); var; var = var->next) {
 		RAII_VAR(struct aco_option *, opt, aco_option_find(container, var->name, cat), ao2_cleanup);
 		if (!opt) {
-			ast_log(LOG_WARNING, "Could not find option suitable for category '%s' named '%s'\n", cat, var->name);
+			ast_log(LOG_WARNING, "Could not find option suitable for category '%s' named '%s' at line %d\n", cat, var->name, var->lineno);
 			return -1;
 		}
 		if (!opt->handler) {




More information about the svn-commits mailing list