[asterisk-commits] mmichelson: branch group/CCSS r225558 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 22 17:35:46 CDT 2009


Author: mmichelson
Date: Thu Oct 22 17:35:43 2009
New Revision: 225558

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225558
Log:
Set up a CC dynamic logger level.

Just did a blind regex replacement on all LOG_NOTICE level
messages so that they log to the CC level now. Next step is
to go through each one and figure out which ones should stay and
which should go.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=225558&r1=225557&r2=225558
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Oct 22 17:35:43 2009
@@ -124,6 +124,9 @@
  */
 static int cc_request_state_change(enum cc_state, int core_id, const char * debug);
 
+static const char *CC_LOGGER_LEVEL_NAME = "CC";
+static int cc_logger_level;
+
 static struct {
 	enum ast_cc_service_type service;
 	const char *service_string;
@@ -220,9 +223,9 @@
 	unsigned long match_flags = *(unsigned long *)data;
 	int possible_match = 0;
 
-	ast_log(LOG_NOTICE, "Iterating on %s, monitor is %p, and flags is %lu\n",
+	ast_log_dynamic_level(cc_logger_level, "Iterating on %s, monitor is %p, and flags is %lu\n",
 			core_instance->agent->interface, core_instance->monitor, match_flags);
-	ast_log(LOG_NOTICE, "Oh and I'm searching for %s\n", name);
+	ast_log_dynamic_level(cc_logger_level, "Oh and I'm searching for %s\n", name);
 
 	if ((match_flags & MATCH_NO_MONITOR) && !core_instance->monitor) {
 		possible_match = 1;
@@ -635,7 +638,7 @@
 	AST_RWLIST_RDLOCK(&cc_monitor_backends);
 	AST_RWLIST_TRAVERSE(&cc_monitor_backends, backend, next) {
 		if (!strcmp(backend->callbacks->type, type)) {
-			ast_log(LOG_NOTICE, "Returning backend %s\n", backend->callbacks->type);
+			ast_log_dynamic_level(cc_logger_level, "Returning backend %s\n", backend->callbacks->type);
 			callbacks = backend->callbacks;
 			break;
 		}
@@ -686,14 +689,14 @@
 		}
 		type = chan_name;
 	} else {
-		ast_log(LOG_NOTICE, "Not returning agent callbacks since this channel is configured not to have a CC agent\n");
+		ast_log_dynamic_level(cc_logger_level, "Not returning agent callbacks since this channel is configured not to have a CC agent\n");
 		return NULL;
 	}
 
 	AST_RWLIST_RDLOCK(&cc_agent_backends);
 	AST_RWLIST_TRAVERSE(&cc_agent_backends, backend, next) {
 		if (!strcmp(backend->callbacks->type, type)) {
-			ast_log(LOG_NOTICE, "Returning backend %s\n", backend->callbacks->type);
+			ast_log_dynamic_level(cc_logger_level, "Returning backend %s\n", backend->callbacks->type);
 			callbacks = backend->callbacks;
 			break;
 		}
@@ -704,7 +707,7 @@
 
 static void destroy_link(struct ast_cc_monitor_link *link)
 {
-	ast_log(LOG_NOTICE, "Destroying link with parent %s and child %s\n",
+	ast_log_dynamic_level(cc_logger_level, "Destroying link with parent %s and child %s\n",
 			link->parent->interface->name, link->child->interface->name);
 	ast_atomic_fetchadd_int(&link->child->num_requests, -1);
 	link->child = cc_unref(link->child, "Unref link's child");
@@ -716,7 +719,7 @@
 static void prune_links(struct ast_cc_monitor *monitor, const int core_id, struct ast_cc_monitor_link *link_parent)
 {
 	struct ast_cc_monitor_link *link_iter;
-	ast_log(LOG_NOTICE, "Prune links called for monitor %s\n", monitor->interface->name);
+	ast_log_dynamic_level(cc_logger_level, "Prune links called for monitor %s\n", monitor->interface->name);
 #if 0
 	ao2_callback(cc_monitors, OBJ_NODATA, print_debug, NULL);
 #endif
@@ -731,7 +734,7 @@
 	AST_LIST_TRAVERSE_SAFE_END;
 
 	if (link_parent) {
-		ast_log(LOG_NOTICE, "Removing parent link from monitor %s\n", monitor->interface->name);
+		ast_log_dynamic_level(cc_logger_level, "Removing parent link from monitor %s\n", monitor->interface->name);
 		AST_LIST_REMOVE(&monitor->parent_links, link_parent, next_parent);
 	}
 
@@ -747,7 +750,7 @@
 		 * CC requests in the system.
 		 */
 		ast_atomic_fetchadd_int(&cc_request_count, -1);
-		ast_log(LOG_NOTICE, "Not unlinking monitor %s because it is the root\n", monitor->interface->name);
+		ast_log_dynamic_level(cc_logger_level, "Not unlinking monitor %s because it is the root\n", monitor->interface->name);
 		return;
 	}
 	if (AST_LIST_EMPTY(&monitor->parent_links) &&
@@ -755,7 +758,7 @@
 		/* This should cause the monitor's destructor
 		 * callback to be called
 		 */
-		ast_log(LOG_NOTICE, "Unlinking monitor %s\n", monitor->interface->name);
+		ast_log_dynamic_level(cc_logger_level, "Unlinking monitor %s\n", monitor->interface->name);
 		ao2_t_unlink(cc_monitors, monitor, "Unlink monitor since nothing refers to it anymore");
 	}
 }
@@ -881,7 +884,7 @@
 static void cc_extension_monitor_destructor(void *monitor)
 {
 	struct ast_cc_monitor *mon = monitor;
-	ast_log(LOG_NOTICE, "Calling destructor for monitor %s\n", mon->interface->name);
+	ast_log_dynamic_level(cc_logger_level, "Calling destructor for monitor %s\n", mon->interface->name);
 	return;
 }
 
@@ -925,7 +928,7 @@
 	if (!gen_mon_pvt) {
 		return -1;
 	}
-	ast_log(LOG_NOTICE, "Allocated a generic monitor pvt for device %s\n", monitor->interface->name);
+	ast_log_dynamic_level(cc_logger_level, "Allocated a generic monitor pvt for device %s\n", monitor->interface->name);
 	monitor->private_data = gen_mon_pvt;
 	return 0;
 }
@@ -1114,7 +1117,7 @@
 		return 0;
 	}
 
-	ast_log(LOG_NOTICE, "Canceling generic monitor available timer for monitor %s\n", monitor->interface->name);
+	ast_log_dynamic_level(cc_logger_level, "Canceling generic monitor available timer for monitor %s\n", monitor->interface->name);
 	ast_sched_thread_del(cc_sched_thread, *sched_id);
 	return 0;
 }
@@ -1124,7 +1127,7 @@
 	struct ast_cc_monitor *mon = monitor;
 	struct generic_monitor_pvt *gen_mon_pvt = mon->private_data;
 
-	ast_log(LOG_NOTICE, "Destroying generic monitor private\n");
+	ast_log_dynamic_level(cc_logger_level, "Destroying generic monitor private\n");
 	if (gen_mon_pvt->sub) {
 		gen_mon_pvt->sub = ast_event_unsubscribe(gen_mon_pvt->sub);
 	}
@@ -1183,7 +1186,7 @@
 static void cc_interface_destroy(void *data)
 {
 	struct ast_cc_interface *interface = data;
-	ast_log(LOG_NOTICE, "Destroying cc interface %s\n", interface->name);
+	ast_log_dynamic_level(cc_logger_level, "Destroying cc interface %s\n", interface->name);
 	ast_cc_config_params_destroy(interface->config_params);
 }
 
@@ -1403,7 +1406,7 @@
 	cc_interface->monitor_class = AST_CC_EXTENSION_MONITOR;
 	strcpy(cc_interface->name, ast_str_buffer(str));
 	tree_item->interface = cc_interface;
-	ast_log(LOG_NOTICE, "Created an extension cc interface for '%s' with id %d and parent %d\n", cc_interface->name, tree_item->id, tree_item->parent_id);
+	ast_log_dynamic_level(cc_logger_level, "Created an extension cc interface for '%s' with id %d and parent %d\n", cc_interface->name, tree_item->id, tree_item->parent_id);
 	return tree_item;
 }
 
@@ -1525,7 +1528,7 @@
 	cc_interface->monitor_class = AST_CC_DEVICE_MONITOR;
 	tree_item->interface = cc_interface;
 	ast_cc_copy_config_params(cc_interface->config_params, cc_data->config_params);
-	ast_log(LOG_NOTICE, "Created a device cc interface for '%s' with id %d and parent %d\n", cc_interface->name, tree_item->id, tree_item->parent_id);
+	ast_log_dynamic_level(cc_logger_level, "Created a device cc interface for '%s' with id %d and parent %d\n", cc_interface->name, tree_item->id, tree_item->parent_id);
 	return tree_item;
 }
 
@@ -1581,7 +1584,7 @@
 	AST_LIST_LOCK(cc_interfaces->interface_tree);
 	AST_LIST_TRAVERSE(cc_interfaces->interface_tree, tree_item, next) {
 		if (!strcmp(tree_item->interface->name, device_name)) {
-			ast_log(LOG_NOTICE, "Device %s sent us multiple CC control frames. Ignoring those beyond the first.\n", device_name);
+			ast_log_dynamic_level(cc_logger_level, "Device %s sent us multiple CC control frames. Ignoring those beyond the first.\n", device_name);
 			AST_LIST_UNLOCK(cc_interfaces->interface_tree);
 			return;
 		}
@@ -1690,7 +1693,7 @@
 	if (interfaces->done) {
 		/* Situation 3 has occurred */
 		*ignore_cc = 1;
-		ast_log(LOG_NOTICE, "Datastore is present with done flag set. Ignoring CC offers on this call\n");
+		ast_log_dynamic_level(cc_logger_level, "Datastore is present with done flag set. Ignoring CC offers on this call\n");
 		return 0;
 	}
 
@@ -1739,7 +1742,7 @@
 	long agent_count = 0;
 
 	ao2_t_callback_data(cc_core_instances, OBJ_NODATA, count_agents_cb, (char *)caller, &agent_count, "Counting agents");
-	ast_log(LOG_NOTICE, "Counted %ld agents\n", agent_count);
+	ast_log_dynamic_level(cc_logger_level, "Counted %ld agents\n", agent_count);
 	return agent_count;
 }
 
@@ -1789,7 +1792,7 @@
 		return NULL;
 	}
 	agent->interface_tree = cc_ref(interface_tree, "Agent now has reference to interface tree");
-	ast_log(LOG_NOTICE, "I created an agent with core_id %d and caller %s\n", agent->core_id, agent->interface);
+	ast_log_dynamic_level(cc_logger_level, "I created an agent with core_id %d and caller %s\n", agent->core_id, agent->interface);
 	return agent;
 }
 
@@ -1859,7 +1862,7 @@
 {
 	const struct ast_cc_agent *agent = data;
 	struct cc_generic_agent_pvt *agent_pvt = agent->private_data;
-	ast_log(LOG_NOTICE, "Queuing change request because offer timer has expired.\n");
+	ast_log_dynamic_level(cc_logger_level, "Queuing change request because offer timer has expired.\n");
 	agent_pvt->offer_timer_id = -1;
 	ast_cc_failed(agent->core_id, "Generic agent offer timer expired");
 	return 0;
@@ -1875,7 +1878,7 @@
 	ast_assert(agent->cc_params != NULL);
 
 	when = ast_get_cc_offer_timer(agent->cc_params) * 1000;
-	ast_log(LOG_NOTICE, "About to schedule timer expiration for %d ms\n", when);
+	ast_log_dynamic_level(cc_logger_level, "About to schedule timer expiration for %d ms\n", when);
 	if ((sched_id = ast_sched_thread_add(cc_sched_thread, when, offer_timer_expire, agent)) == -1) {
 		return -1;
 	}
@@ -1963,12 +1966,12 @@
 	if (!(chan = ast_request_and_dial(tech, AST_FORMAT_SLINEAR, NULL, target, 20000, &reason, NULL, NULL))) {
 		/* Hmm, no channel. Sucks for you, bud.
 		 */
-		ast_log(LOG_NOTICE, "Failed to call back %s for reason %d\n", agent->interface, reason);
+		ast_log_dynamic_level(cc_logger_level, "Failed to call back %s for reason %d\n", agent->interface, reason);
 		ast_cc_failed(agent->core_id, "Failed to call back interface\n");
 		return NULL;
 	}
 	if (!ast_strlen_zero(callback_macro)) {
-		ast_log(LOG_NOTICE, "There's a callback macro configured\n");
+		ast_log_dynamic_level(cc_logger_level, "There's a callback macro configured\n");
 		if (ast_app_run_macro(NULL, chan, callback_macro, NULL)) {
 			ast_cc_failed(agent->core_id, "Callback macro failed. Maybe a hangup?");
 			ast_hangup(chan);
@@ -2019,7 +2022,7 @@
 static void cc_core_instance_destructor(void *data)
 {
 	struct cc_core_instance *core_instance = data;
-	ast_log(LOG_NOTICE, "Destroying core instance %d\n", core_instance->core_id);
+	ast_log_dynamic_level(cc_logger_level, "Destroying core instance %d\n", core_instance->core_id);
 	agent_destroy(core_instance->agent);
 	if (core_instance->monitor) {
 		prune_links(core_instance->monitor, core_instance->core_id, NULL);
@@ -2042,14 +2045,14 @@
 
 	agent_count = count_agents(caller);
 	if (agent_count >= ast_get_cc_max_agents(ast_channel_get_cc_config_params(caller_chan))) {
-		ast_log(LOG_NOTICE, "Caller %s already has the maximum number of agents configured\n", caller);
+		ast_log_dynamic_level(cc_logger_level, "Caller %s already has the maximum number of agents configured\n", caller);
 		return -1;
 	}
 
 	/* Generic agents can only have a single outstanding CC request per caller. */
 	if (ast_get_cc_agent_policy(ast_channel_get_cc_config_params(caller_chan)) == AST_CC_AGENT_GENERIC &&
 			agent_count > 0) {
-		ast_log(LOG_NOTICE, "Generic agents can only have a single outstanding request\n");
+		ast_log_dynamic_level(cc_logger_level, "Generic agents can only have a single outstanding request\n");
 		return -1;
 	}
 
@@ -2077,7 +2080,7 @@
 static void monitor_destroy(void *data)
 {
 	struct ast_cc_monitor *monitor = data;
-	ast_log(LOG_NOTICE, "Destructor called for monitor %s\n", monitor->interface->name);
+	ast_log_dynamic_level(cc_logger_level, "Destructor called for monitor %s\n", monitor->interface->name);
 	monitor->callbacks->destructor(monitor);
 	cc_unref(monitor->interface, "Remove monitor's reference to interface");
 }
@@ -2099,7 +2102,7 @@
 	monitor->callbacks->init(monitor, core_id);
 	AST_LIST_HEAD_INIT(&monitor->child_links);
 	AST_LIST_HEAD_INIT(&monitor->parent_links);
-	ast_log(LOG_NOTICE, "Created new monitor named %s of type %s\n", monitor->interface->name, monitor->interface->monitor_type);
+	ast_log_dynamic_level(cc_logger_level, "Created new monitor named %s of type %s\n", monitor->interface->name, monitor->interface->monitor_type);
 	ao2_t_link(cc_monitors, monitor, "Link monitor into container");
 #if 0
 	ao2_callback(cc_monitors, OBJ_NODATA, print_debug, NULL);
@@ -2126,7 +2129,7 @@
 	struct ast_cc_interface *interface = tree_item->interface;
 
 	if ((new_monitor = find_monitor(interface->name, interface->monitor_type))) {
-		ast_log(LOG_NOTICE, "Found monitor %s in tree. Re-using\n", new_monitor->interface->name);
+		ast_log_dynamic_level(cc_logger_level, "Found monitor %s in tree. Re-using\n", new_monitor->interface->name);
 	} else if (!(new_monitor = cc_monitor_instance_init(interface, core_id))) {
 		return NULL;
 	}
@@ -2145,7 +2148,7 @@
 	ast_atomic_fetchadd_int(&new_monitor->num_requests, +1);
 	AST_LIST_INSERT_TAIL(&parent->child_links, new_link, next_child);
 	AST_LIST_INSERT_TAIL(&new_monitor->parent_links, new_link, next_parent);
-	ast_log(LOG_NOTICE, "Created link with core_id %d, parent %s and child %s\n", new_link->core_id, new_link->parent->interface->name, new_link->child->interface->name);
+	ast_log_dynamic_level(cc_logger_level, "Created link with core_id %d, parent %s and child %s\n", new_link->core_id, new_link->parent->interface->name, new_link->child->interface->name);
 	return new_monitor;
 }
 
@@ -2289,7 +2292,7 @@
 	 */
 	AST_LIST_TRAVERSE(&monitor->parent_links, link, next_parent) {
 		if (!link->is_suspended) {
-			ast_log(LOG_NOTICE, "Selected link with core_id %d\n", link->core_id);
+			ast_log_dynamic_level(cc_logger_level, "Selected link with core_id %d\n", link->core_id);
 			break;
 		}
 	}
@@ -2326,10 +2329,10 @@
 	struct cc_core_instance *core_instance;
 	struct cc_core_instance finder = { .core_id = args->core_id };
 
-	ast_log(LOG_NOTICE, "State change to %d requested. Reason: %s\n", args->state, args->debug);
+	ast_log_dynamic_level(cc_logger_level, "State change to %d requested. Reason: %s\n", args->state, args->debug);
 
 	if (!(core_instance = ao2_t_find(cc_core_instances, &finder, OBJ_POINTER, "Find core instance so state change can occur"))) {
-		ast_log(LOG_NOTICE, "Unable to find core instance %d\n", args->core_id);
+		ast_log_dynamic_level(cc_logger_level, "Unable to find core instance %d\n", args->core_id);
 		ast_free(args);
 		return -1;
 	}
@@ -2341,7 +2344,7 @@
 		break;
 	case CC_CALLER_OFFERED:
 		if (core_instance->current_state != CC_AVAILABLE) {
-			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n",
+			ast_log_dynamic_level(cc_logger_level, "Invalid state change request. Cannot go from %d to %d\n",
 					core_instance->current_state, args->state);
 			break;
 		}
@@ -2354,7 +2357,7 @@
 			"Caller: %s\r\n"
 			"Expires: %u\r\n",
 			core_instance->core_id, core_instance->agent->interface, core_instance->agent->cc_params->cc_offer_timer);
-		ast_log(LOG_NOTICE, "Started the offer timer for the agent!\n");
+		ast_log_dynamic_level(cc_logger_level, "Started the offer timer for the agent!\n");
 		core_instance->current_state = args->state;
 		break;
 	case CC_CALLER_REQUESTED:
@@ -2364,7 +2367,7 @@
 		 */
 		if (!(core_instance->current_state == CC_CALLER_OFFERED ||
 				(core_instance->current_state == CC_AVAILABLE && ast_test_flag(core_instance->agent, AST_CC_AGENT_SKIP_OFFER)))) {
-			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n",
+			ast_log_dynamic_level(cc_logger_level, "Invalid state change request. Cannot go from %d to %d\n",
 					core_instance->current_state, args->state);
 			break;
 		}
@@ -2403,7 +2406,7 @@
 				core_instance->core_id, core_instance->agent->interface);
 			core_instance->monitor->callbacks->unsuspend(core_instance->monitor, core_instance->core_id);
 		} else {
-			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n",
+			ast_log_dynamic_level(cc_logger_level, "Invalid state change request. Cannot go from %d to %d\n",
 					core_instance->current_state, args->state);
 		}
 		break;
@@ -2411,16 +2414,16 @@
 		/* Callee has become available, call agent's status request callback
 		 */
 		if (core_instance->current_state != CC_ACTIVE) {
-			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n",
+			ast_log_dynamic_level(cc_logger_level, "Invalid state change request. Cannot go from %d to %d\n",
 					core_instance->current_state, args->state);
 			break;
 		}
 		core_instance->current_state = args->state;
 		if (core_instance->agent->callbacks->status_request(core_instance->agent) == AST_DEVICE_NOT_INUSE) {
-			ast_log(LOG_NOTICE, "Both parties are ready, let's try that recall\n");
+			ast_log_dynamic_level(cc_logger_level, "Both parties are ready, let's try that recall\n");
 			cc_request_state_change(CC_RECALLING, core_instance->core_id, "Both parties are available\n");
 		} else {
-			ast_log(LOG_NOTICE, "Caller has become busy, so we must begin monitoring him\n");
+			ast_log_dynamic_level(cc_logger_level, "Caller has become busy, so we must begin monitoring him\n");
 			cc_request_state_change(CC_CALLER_BUSY, core_instance->core_id, "Caller is busy\n");
 		}
 		break;
@@ -2429,7 +2432,7 @@
 		 * and call monitor's suspend callback.
 		 */
 		if (core_instance->current_state != CC_CALLEE_READY) {
-			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n",
+			ast_log_dynamic_level(cc_logger_level, "Invalid state change request. Cannot go from %d to %d\n",
 					core_instance->current_state, args->state);
 			break;
 		}
@@ -2445,7 +2448,7 @@
 		/* Both caller and callee are available, call agent's recall callback
 		 */
 		if (core_instance->current_state != CC_CALLEE_READY) {
-			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n",
+			ast_log_dynamic_level(cc_logger_level, "Invalid state change request. Cannot go from %d to %d\n",
 					core_instance->current_state, args->state);
 			break;
 		}
@@ -2461,7 +2464,7 @@
 		/* Recall has made progress, call agent and monitor destructor functions
 		 */
 		if (core_instance->current_state != CC_RECALLING) {
-			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n",
+			ast_log_dynamic_level(cc_logger_level, "Invalid state change request. Cannot go from %d to %d\n",
 					core_instance->current_state, args->state);
 			break;
 		}
@@ -2506,7 +2509,7 @@
 	args->core_id = core_id;
 	strcpy(args->debug, debug);
 
-	ast_log(LOG_NOTICE, "Placing request for state change to state %d\n", state);
+	ast_log_dynamic_level(cc_logger_level, "Placing request for state change to state %d\n", state);
 	return ast_taskprocessor_push(cc_core_taskprocessor, cc_do_state_change, args);
 }
 
@@ -2567,20 +2570,20 @@
 
 	match_flags = MATCH_NO_MONITOR;
 	if (!(core_instance = ao2_t_callback_data(cc_core_instances, 0, match_agent, interface, &match_flags, "Find core instance for CallCompletionRequest"))) {
-		ast_log(LOG_NOTICE, "Couldn't find a core instance for caller %s\n", interface);
-		return -1;
-	}
-
-	ast_log(LOG_NOTICE, "Found core_instance with core_id %d\n", core_instance->core_id);
+		ast_log_dynamic_level(cc_logger_level, "Couldn't find a core instance for caller %s\n", interface);
+		return -1;
+	}
+
+	ast_log_dynamic_level(cc_logger_level, "Found core_instance with core_id %d\n", core_instance->core_id);
 
 	if (strcmp(core_instance->agent->callbacks->type, "generic")) {
-		ast_log(LOG_NOTICE, "CallCompletionRequest is only for generic agent types.\n");
+		ast_log_dynamic_level(cc_logger_level, "CallCompletionRequest is only for generic agent types.\n");
 		cc_unref(core_instance, "Unref core_instance since CallCompletionRequest was called with native agent");
 		return -1;
 	}
 
 	if (!ast_cc_request_within_limits()) {
-		ast_log(LOG_NOTICE, "CallCompletionRequest failed. Too many requests in the system\n");
+		ast_log_dynamic_level(cc_logger_level, "CallCompletionRequest failed. Too many requests in the system\n");
 		ast_cc_failed(core_instance->core_id, "Too many CC requests\n");
 		return -1;
 	}
@@ -2753,7 +2756,7 @@
 	}
 
 	pbx_builtin_setvar_helper(chan, "CC_INTERFACES", ast_str_buffer(var_value));
-	ast_log(LOG_NOTICE, "I set CC_INTERFACES to %s\n", ast_str_buffer(var_value));
+	ast_log_dynamic_level(cc_logger_level, "I set CC_INTERFACES to %s\n", ast_str_buffer(var_value));
 	ast_channel_unlock(chan);
 	ast_free(var_value);
 	return 0;
@@ -2919,6 +2922,7 @@
 	}
 	ast_log(LOG_NOTICE, "Successfully created the root CC monitor\n");
 	ast_cli_register_multiple(cc_cli, ARRAY_LEN(cc_cli));
+	cc_logger_level = ast_logger_register_level(CC_LOGGER_LEVEL_NAME);
 	/* FOR THE LOVE OF GOD DO NOT SET root_monitor TO NULL HERE */
 	cc_unref(root_monitor, "Unref root monitor from allocation");
 	dialed_cc_interface_counter = 1;




More information about the asterisk-commits mailing list